auto login from activation

This commit is contained in:
Johannes Zellner
2024-04-03 18:23:29 +02:00
parent 2f6a66dbd7
commit 5744cb7318
4 changed files with 13 additions and 11 deletions
+5 -2
View File
@@ -71,6 +71,7 @@ app.controller('SetupAccountController', ['$scope', '$translate', '$http', funct
$scope.error = null;
$scope.view = 'setup';
$scope.branding = null;
$scope.dashboardUrl = '';
$scope.profileLocked = !!search.profileLocked;
$scope.existingUsername = !!search.username;
@@ -122,8 +123,10 @@ app.controller('SetupAccountController', ['$scope', '$translate', '$http', funct
$http.post(API_ORIGIN + '/api/v1/auth/setup_account', data).success(function (data, status) {
if (status !== 201) return error(data, status);
// set token to autologin
localStorage.token = data.accessToken;
// set token to autologin on first oauth flow
localStorage.cloudronFirstTimeToken = data.accessToken;
$scope.dashboardUrl = '/openid/auth?client_id=cid-webadmin&scope=openid email profile&response_type=code token&redirect_uri=' + window.location.origin + '/authcallback.html';
$scope.view = 'done';
}).error(error);