Skip to content

Commit

Permalink
fix oauth redirect (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErmiasG authored Oct 20, 2021
1 parent 9eddd29 commit fd7b7ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hopsworks-web/yo/app/scripts/controllers/oauthCallbackCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ angular.module('hopsWorksApp')
AuthService.oauthLogin(user).then(function (success) {
self.working = false;
AuthService.saveToken(success.headers('Authorization'));
$cookies.put("email", success.data.data.value);
if (success.data) {
$cookies.put("email", success.data.data.value);
}
$location.path('/');
}, function (error) {
if (error !== undefined && error.status === 412) {
Expand All @@ -43,7 +45,6 @@ angular.module('hopsWorksApp')
user = {code: '', state: '', chosenEmail: '', consent: ''};
$location.path('/login');
}
console.log("success", success);
}, function (error) {
user = {code: '', state: '', chosenEmail: '', consent: ''};
$location.path('/login');
Expand Down

0 comments on commit fd7b7ac

Please sign in to comment.