dashboard: if access_token is provided, automatically attempt login

fixes cloudron/box#747
This commit is contained in:
Girish Ramakrishnan
2020-12-22 10:00:56 -08:00
parent 29f7b771a1
commit 26662b9ed9
+10 -3
View File
@@ -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();
}
}]);