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