From 06bc4ceeb1e43679ea2b2b6cf006855e67f401b6 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Sun, 18 Nov 2012 23:21:31 +0100 Subject: [PATCH] fixed #64 --- WebKit/scripts/controller/Oauth.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WebKit/scripts/controller/Oauth.js b/WebKit/scripts/controller/Oauth.js index ef89871..3233967 100644 --- a/WebKit/scripts/controller/Oauth.js +++ b/WebKit/scripts/controller/Oauth.js @@ -68,12 +68,17 @@ function(HostApp, Paths, Hmac) { Oauth.prototype.register = function (url) { var those = this; Paths.getURL(url, "GET", function(resp) { + those.profile = JSON.parse(resp.responseText); + those.entity = those.profile["https://tent.io/types/info/core/v0.1.0"].entity; + HostApp.setStringForKey(those.entity, "entity") HostApp.setStringForKey(those.apiRoot(), "api_root"); + var callback = function(resp) { var data = JSON.parse(resp.responseText); those.authRequest(data); } + Paths.getURL(Paths.mkApiRootPath("/apps"), "POST", callback, JSON.stringify(those.app_info)); }); } @@ -146,7 +151,6 @@ function(HostApp, Paths, Hmac) { HostApp.setStringForKey(access["token_type"], "user_token_type"); HostApp.loggedIn(); - console.log("D") } Oauth.prototype.logout = function() {