[frontend] Set sessions cookie to string of tokens
This commit is contained in:
parent
a4177a2697
commit
1ace285d35
1 changed files with 5 additions and 4 deletions
|
@ -75,8 +75,9 @@ internal class SessionService
|
||||||
ApiService.SetBearerToken(user.Token);
|
ApiService.SetBearerToken(user.Token);
|
||||||
Current = user;
|
Current = user;
|
||||||
LocalStorage.SetItem("last_user", user.Id);
|
LocalStorage.SetItem("last_user", user.Id);
|
||||||
|
var sessionsString = Users.Aggregate("", (current, el) => current + $"{el.Value.Token},").TrimEnd(',');
|
||||||
((IJSInProcessRuntime)Js).InvokeVoid("eval",
|
((IJSInProcessRuntime)Js).InvokeVoid("eval",
|
||||||
$"document.cookie = \"session={user.Id}; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Lax\"");
|
$"document.cookie = \"sessions={sessionsString}; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Lax\"");
|
||||||
if (user.IsAdmin)
|
if (user.IsAdmin)
|
||||||
{
|
{
|
||||||
((IJSInProcessRuntime)Js).InvokeVoid("eval",
|
((IJSInProcessRuntime)Js).InvokeVoid("eval",
|
||||||
|
|
Loading…
Add table
Reference in a new issue