@howone/sdk 0.3.6 → 0.3.7
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.
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -439,7 +439,7 @@ declare const AUTH_TOKEN_KEY = "auth_token";
|
|
|
439
439
|
declare function setToken(token: string | null): void;
|
|
440
440
|
declare function getToken(): string | null;
|
|
441
441
|
declare function parseUserFromToken(token: string | null): {
|
|
442
|
-
id:
|
|
442
|
+
id: {};
|
|
443
443
|
email: string;
|
|
444
444
|
name: string;
|
|
445
445
|
avatar: string;
|
|
@@ -448,7 +448,7 @@ declare function isTokenValid(token: string | null): boolean;
|
|
|
448
448
|
declare function useAuth(): {
|
|
449
449
|
token: string | null;
|
|
450
450
|
user: {
|
|
451
|
-
id:
|
|
451
|
+
id: {};
|
|
452
452
|
email: string;
|
|
453
453
|
name: string;
|
|
454
454
|
avatar: string;
|
|
@@ -855,7 +855,7 @@ declare function createClient(opts: {
|
|
|
855
855
|
delete(id: string): Promise<void>;
|
|
856
856
|
};
|
|
857
857
|
me: () => Promise<{
|
|
858
|
-
id:
|
|
858
|
+
id: {};
|
|
859
859
|
email: string;
|
|
860
860
|
name: string;
|
|
861
861
|
avatar: string;
|
|
@@ -933,7 +933,7 @@ declare class HowoneAuthClient {
|
|
|
933
933
|
login(): void;
|
|
934
934
|
logout(): void;
|
|
935
935
|
getUser(): {
|
|
936
|
-
id:
|
|
936
|
+
id: {};
|
|
937
937
|
email: string;
|
|
938
938
|
name: string;
|
|
939
939
|
avatar: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -439,7 +439,7 @@ declare const AUTH_TOKEN_KEY = "auth_token";
|
|
|
439
439
|
declare function setToken(token: string | null): void;
|
|
440
440
|
declare function getToken(): string | null;
|
|
441
441
|
declare function parseUserFromToken(token: string | null): {
|
|
442
|
-
id:
|
|
442
|
+
id: {};
|
|
443
443
|
email: string;
|
|
444
444
|
name: string;
|
|
445
445
|
avatar: string;
|
|
@@ -448,7 +448,7 @@ declare function isTokenValid(token: string | null): boolean;
|
|
|
448
448
|
declare function useAuth(): {
|
|
449
449
|
token: string | null;
|
|
450
450
|
user: {
|
|
451
|
-
id:
|
|
451
|
+
id: {};
|
|
452
452
|
email: string;
|
|
453
453
|
name: string;
|
|
454
454
|
avatar: string;
|
|
@@ -855,7 +855,7 @@ declare function createClient(opts: {
|
|
|
855
855
|
delete(id: string): Promise<void>;
|
|
856
856
|
};
|
|
857
857
|
me: () => Promise<{
|
|
858
|
-
id:
|
|
858
|
+
id: {};
|
|
859
859
|
email: string;
|
|
860
860
|
name: string;
|
|
861
861
|
avatar: string;
|
|
@@ -933,7 +933,7 @@ declare class HowoneAuthClient {
|
|
|
933
933
|
login(): void;
|
|
934
934
|
logout(): void;
|
|
935
935
|
getUser(): {
|
|
936
|
-
id:
|
|
936
|
+
id: {};
|
|
937
937
|
email: string;
|
|
938
938
|
name: string;
|
|
939
939
|
avatar: string;
|
package/dist/index.js
CHANGED
|
@@ -172,7 +172,7 @@ function parseUserFromToken(token) {
|
|
|
172
172
|
const payload = decodeJwtPayload(token);
|
|
173
173
|
if (!payload) return null;
|
|
174
174
|
return {
|
|
175
|
-
id: payload.userId || payload.sub || "",
|
|
175
|
+
id: payload.puid || payload.userId || payload.sub || "",
|
|
176
176
|
email: payload.email || "",
|
|
177
177
|
name: payload.name || "",
|
|
178
178
|
avatar: payload.avatar || payload.picture || ""
|