@alien_org/sso-sdk-core 1.0.8 → 1.0.9
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/client.d.ts +1 -1
- package/dist/client.js +2 -1
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare class AlienSsoSdkClient {
|
|
|
21
21
|
getAuthDeeplink(): Promise<AuthorizeResponse>;
|
|
22
22
|
pollAuth(pollingCode: string): Promise<string>;
|
|
23
23
|
exchangeToken(authorizationCode: string): Promise<string>;
|
|
24
|
-
verifyAuth(): Promise<boolean>;
|
|
24
|
+
verifyAuth(providerAddress: string): Promise<boolean>;
|
|
25
25
|
getAccessToken(): string | null;
|
|
26
26
|
getAuthData(): TokenInfo | null;
|
|
27
27
|
logout(): void;
|
package/dist/client.js
CHANGED
|
@@ -119,13 +119,14 @@ export class AlienSsoSdkClient {
|
|
|
119
119
|
throw new Error('Exchange failed');
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
async verifyAuth() {
|
|
122
|
+
async verifyAuth(providerAddress) {
|
|
123
123
|
const access_token = this.getAccessToken();
|
|
124
124
|
if (!access_token) {
|
|
125
125
|
throw new Error('Access token is invalid.');
|
|
126
126
|
}
|
|
127
127
|
const verifyTokenPayload = {
|
|
128
128
|
access_token,
|
|
129
|
+
provider_address: providerAddress,
|
|
129
130
|
};
|
|
130
131
|
VerifyTokenRequestSchema.parse(verifyTokenPayload);
|
|
131
132
|
const response = await fetch(joinUrl(this.config.ssoBaseUrl, '/access_token/verify'), {
|
package/dist/schema.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export type ExchangeCodeResponse = z.infer<typeof ExchangeCodeResponseSchema>;
|
|
|
54
54
|
*/
|
|
55
55
|
export declare const VerifyTokenRequestSchema: z.ZodMiniObject<{
|
|
56
56
|
access_token: z.ZodMiniString<string>;
|
|
57
|
+
provider_address: z.ZodMiniString<string>;
|
|
57
58
|
}, z.core.$strip>;
|
|
58
59
|
export type VerifyTokenRequest = z.infer<typeof VerifyTokenRequestSchema>;
|
|
59
60
|
export declare const VerifyTokenResponseSchema: z.ZodMiniObject<{
|
package/dist/schema.js
CHANGED
|
@@ -46,6 +46,7 @@ export const ExchangeCodeResponseSchema = z.object({
|
|
|
46
46
|
*/
|
|
47
47
|
export const VerifyTokenRequestSchema = z.object({
|
|
48
48
|
access_token: z.string(),
|
|
49
|
+
provider_address: z.string(),
|
|
49
50
|
});
|
|
50
51
|
export const VerifyTokenResponseSchema = z.object({
|
|
51
52
|
is_valid: z.boolean(),
|