@progalaxyelabs/ngx-stonescriptphp-client 1.23.5 → 1.24.1
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/index.d.ts
CHANGED
|
@@ -200,6 +200,7 @@ interface User {
|
|
|
200
200
|
display_name: string;
|
|
201
201
|
photo_url?: string;
|
|
202
202
|
is_email_verified: boolean;
|
|
203
|
+
role?: string;
|
|
203
204
|
}
|
|
204
205
|
interface OtpSendResponse {
|
|
205
206
|
success: boolean;
|
|
@@ -505,6 +506,14 @@ declare class TokenService {
|
|
|
505
506
|
* Token is treated as opaque — validity is determined by the auth server.
|
|
506
507
|
*/
|
|
507
508
|
hasValidAccessToken(): boolean;
|
|
509
|
+
/**
|
|
510
|
+
* Decode the payload of a JWT without verifying the signature.
|
|
511
|
+
* Returns the parsed claims object, or null if the token is invalid/missing.
|
|
512
|
+
*
|
|
513
|
+
* Usage: const claims = tokenService.decodeJwtPayload(token);
|
|
514
|
+
* const role = claims?.role;
|
|
515
|
+
*/
|
|
516
|
+
decodeJwtPayload(token?: string): Record<string, any> | null;
|
|
508
517
|
static ɵfac: i0.ɵɵFactoryDeclaration<TokenService, never>;
|
|
509
518
|
static ɵprov: i0.ɵɵInjectableDeclaration<TokenService>;
|
|
510
519
|
}
|
|
@@ -579,6 +588,11 @@ declare class AuthService {
|
|
|
579
588
|
private saveUser;
|
|
580
589
|
private updateUser;
|
|
581
590
|
private storeAuthResult;
|
|
591
|
+
/**
|
|
592
|
+
* Decode the access token and attach the `role` claim to the user object.
|
|
593
|
+
* Falls back to role from the membership field in the AuthResult if no JWT role found.
|
|
594
|
+
*/
|
|
595
|
+
private enrichUserWithJwtRole;
|
|
582
596
|
loginWithEmail(email: string, password: string): Promise<AuthResult>;
|
|
583
597
|
loginWithGoogle(serverName?: string): Promise<AuthResult>;
|
|
584
598
|
loginWithGitHub(serverName?: string): Promise<AuthResult>;
|