dashboard: if access_token is provided, automatically attempt login
fixes cloudron/box#747
This commit is contained in:
+10
-3
@@ -183,7 +183,14 @@ app.controller('LoginController', ['$scope', '$translate', '$http', function ($s
|
||||
});
|
||||
|
||||
// Init into the correct view
|
||||
if (search.passwordReset) $scope.showPasswordReset();
|
||||
else if (search.resetToken) $scope.showNewPassword();
|
||||
else $scope.showLogin();
|
||||
if (search.passwordReset) {
|
||||
$scope.showPasswordReset();
|
||||
} else if (search.resetToken) {
|
||||
$scope.showNewPassword();
|
||||
} else if (search.accessToken || search.access_token) { // auto-login feature
|
||||
localStorage.token = search.accessToken || search.access_token;
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
$scope.showLogin();
|
||||
}
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user