@airsoko/auth 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,17 @@ export declare class AuthClient {
|
|
|
11
11
|
* @param token
|
|
12
12
|
* @returns
|
|
13
13
|
*/
|
|
14
|
-
signIn(
|
|
14
|
+
signIn(
|
|
15
|
+
/**
|
|
16
|
+
* The auth token to be stored
|
|
17
|
+
*/
|
|
18
|
+
token: string, { redirect, }?: {
|
|
19
|
+
/**
|
|
20
|
+
* where to redirect using the stored url from session
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
redirect: boolean;
|
|
24
|
+
}): Promise<boolean>;
|
|
15
25
|
/**
|
|
16
26
|
* Logs the user out by removing the authentication token.
|
|
17
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/client.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAItE,qBAAa,UAAU;IAInB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,QAAQ;IANlB,OAAO,CAAC,SAAS,CAAuB;gBAG9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,YAAY;IAShC;;;;OAIG;IACU,MAAM;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,EACb,EACE,QAAQ,GACT,GAAE;QACD;;;WAGG;QACH,QAAQ,EAAE,OAAO,CAAC;KACE;IASxB;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAWpC;;;OAGG;IACI,YAAY,IAAI,MAAM,GAAG,IAAI;IAIpC;;;OAGG;IACI,eAAe,IAAI,OAAO;IAIjC;;;;OAIG;IACI,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAKjD;;;OAGG;IACI,wBAAwB,IAAI,OAAO;IAI1C;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAItC;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAMvC;;;OAGG;IACI,6BAA6B,IAAI,OAAO;IAK/C;;;OAGG;IACI,4BAA4B,IAAI,OAAO;IAM9C;;;;;OAKG;IAEU,OAAO,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAcnD;;;;;OAKG;IAEU,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW9E;;;;;OAKG;IAEU,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;IAOrD;;;OAGG;IACI,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOxC;;;;;OAKG;IACU,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAehD;;;OAGG;IACI,mBAAmB,IAAI,IAAI;IA+ClC;;OAEG;IACI,eAAe,CAAC,EACrB,aAAqB,GACtB,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAetF,OAAO,CAAC,SAAS,CAMf;CACH"}
|
package/dist/src/core/client.js
CHANGED
|
@@ -36,9 +36,15 @@ class AuthClient {
|
|
|
36
36
|
* @param token
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
|
-
async signIn(
|
|
39
|
+
async signIn(
|
|
40
|
+
/**
|
|
41
|
+
* The auth token to be stored
|
|
42
|
+
*/
|
|
43
|
+
token, { redirect, } = { redirect: true }) {
|
|
40
44
|
await this.setAuthToken(token);
|
|
41
|
-
|
|
45
|
+
if (redirect) {
|
|
46
|
+
await this.redirectToStoredUrl();
|
|
47
|
+
}
|
|
42
48
|
return true;
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
@@ -129,12 +135,12 @@ class AuthClient {
|
|
|
129
135
|
const regularUser = await (0, getRegularUser_1.getRegularUser)(authToken);
|
|
130
136
|
if (regularUser)
|
|
131
137
|
return regularUser;
|
|
132
|
-
this.logout();
|
|
138
|
+
// this.logout();
|
|
133
139
|
return this.emptyUser;
|
|
134
140
|
}
|
|
135
141
|
catch (error) {
|
|
136
142
|
console.error("Error in getUser:", error);
|
|
137
|
-
this.logout();
|
|
143
|
+
// this.logout();
|
|
138
144
|
return this.emptyUser;
|
|
139
145
|
}
|
|
140
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,UAAU,oGAStB,CAAC;AAEF,eAAO,MAAM,cAAc,oGAS1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,UAAU,oGAStB,CAAC;AAEF,eAAO,MAAM,cAAc,oGAS1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,gEA6B1B,CAAC"}
|