mirror of
https://github.com/lucaspalomodevelop/auth-tools.git
synced 2026-03-12 22:07:22 +00:00
fix loggedIn logic
This commit is contained in:
parent
a9da951083
commit
d0ac60ef57
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@auth-tools/client",
|
||||
"version": "0.0.1-alpha.9",
|
||||
"version": "0.0.1-alpha.10",
|
||||
"description": "A structured authentication protocol for Javascript. (client)",
|
||||
"main": "dist/index.js",
|
||||
"repository": "https://github.com/auth-tools/auth-tools",
|
||||
|
||||
@ -95,13 +95,16 @@ export class AuthClient extends AuthBase<
|
||||
public async isLoggedIn(): Promise<boolean> {
|
||||
const checkResponse = await this.methods.check({});
|
||||
|
||||
if (checkResponse.clientError || checkResponse.res.error) return false;
|
||||
if (checkResponse.clientError) return false;
|
||||
|
||||
if (!checkResponse.res.error) return true;
|
||||
|
||||
const refreshResponse = await this.methods.refresh({});
|
||||
|
||||
if (refreshResponse.clientError || refreshResponse.res.error) return false;
|
||||
if (refreshResponse.clientError) return false;
|
||||
|
||||
return true;
|
||||
if (!refreshResponse.res.error) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
//get token payload
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user