Skip to content

Commit fd7b7ac

Browse files
authored
fix oauth redirect (#949)
1 parent 9eddd29 commit fd7b7ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hopsworks-web/yo/app/scripts/controllers/oauthCallbackCtrl.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ angular.module('hopsWorksApp')
2929
AuthService.oauthLogin(user).then(function (success) {
3030
self.working = false;
3131
AuthService.saveToken(success.headers('Authorization'));
32-
$cookies.put("email", success.data.data.value);
32+
if (success.data) {
33+
$cookies.put("email", success.data.data.value);
34+
}
3335
$location.path('/');
3436
}, function (error) {
3537
if (error !== undefined && error.status === 412) {
@@ -43,7 +45,6 @@ angular.module('hopsWorksApp')
4345
user = {code: '', state: '', chosenEmail: '', consent: ''};
4446
$location.path('/login');
4547
}
46-
console.log("success", success);
4748
}, function (error) {
4849
user = {code: '', state: '', chosenEmail: '', consent: ''};
4950
$location.path('/login');

0 commit comments

Comments
 (0)