Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Jun 29, 2024
1 parent 923ed9c commit dce045f
Showing 1 changed file with 35 additions and 33 deletions.
68 changes: 35 additions & 33 deletions avRegistration/auth-method-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,39 +836,41 @@ angular.module('avRegistration')
.then(function(response) {
var options = {};
var authToken = response.data['auth-token'];
var decodedToken = authmethod.decodeToken(authToken);
options.expires = new Date(now + 1000 * decodedToken.expiry_secs_diffs);
// update cookies expiration
$cookies.put(
"auth" + postfix,
response.data['auth-token'],
options
);
$cookies.put(
"isAdmin" + postfix,
$cookies.get("isAdmin" + postfix),
options
);
$cookies.put(
"userid" + postfix,
$cookies.get("userid" + postfix),
options
);
$cookies.put(
"userid" + postfix,
$cookies.get("userid" + postfix),
options
);
$cookies.put(
"user" + postfix,
$cookies.get("user" + postfix),
options
);
authmethod.setAuth(
$cookies.get("auth" + postfix),
$cookies.get("isAdmin" + postfix),
autheventid
);
if (authToken) {
var decodedToken = authmethod.decodeToken(authToken);
options.expires = new Date(now + 1000 * decodedToken.expiry_secs_diffs);
// update cookies expiration
$cookies.put(
"auth" + postfix,
response.data['auth-token'],
options
);
$cookies.put(
"isAdmin" + postfix,
$cookies.get("isAdmin" + postfix),
options
);
$cookies.put(
"userid" + postfix,
$cookies.get("userid" + postfix),
options
);
$cookies.put(
"userid" + postfix,
$cookies.get("userid" + postfix),
options
);
$cookies.put(
"user" + postfix,
$cookies.get("user" + postfix),
options
);
authmethod.setAuth(
$cookies.get("auth" + postfix),
$cookies.get("isAdmin" + postfix),
autheventid
);
}

// if it's an election with no children elections
if (angular.isDefined(response.data['vote-permission-token']))
Expand Down

0 comments on commit dce045f

Please sign in to comment.