mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2025-02-22 13:34:57 +00:00
Properly logout of account
This commit is contained in:
parent
f3d4b0e0a2
commit
48375db450
@ -58,7 +58,7 @@
|
||||
on:click={() => {
|
||||
$loginStore = null;
|
||||
localStorage.removeItem("login-session");
|
||||
localStorage.removeItem("pop2_access_token");
|
||||
LOGIN.logout();
|
||||
}}
|
||||
>
|
||||
Logout
|
||||
|
@ -10,6 +10,9 @@ export const LOGIN = {
|
||||
init: () => {
|
||||
POP2.init(TOKEN_AUTHORIZE_API, OAUTH2_CLIENT_ID, "openid profile name", 500, 600);
|
||||
},
|
||||
logout: () => {
|
||||
POP2.logout();
|
||||
},
|
||||
clientRequest: (resource: string, options: RequestInit, refresh: boolean) => {
|
||||
return POP2.clientRequest(resource, options, refresh);
|
||||
},
|
||||
|
@ -128,6 +128,10 @@ export const POP2 = (function (w) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
logout: function () {
|
||||
access_token = "";
|
||||
localStorage.removeItem("pop2_access_token");
|
||||
},
|
||||
clientRequest: function (resource, options, refresh = false) {
|
||||
const sendRequest = function () {
|
||||
options.credentials = "include";
|
||||
|
Loading…
x
Reference in New Issue
Block a user