@savant-realms/federated-auth-realm-sdk-ts-js 0.4.1 → 0.4.2
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 +7 -1
- package/dist/client.js +6 -0
- package/dist/types/index.d.ts +4 -4
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -39,7 +39,13 @@ export declare class FederatedAuthClient {
|
|
|
39
39
|
message: string;
|
|
40
40
|
}>;
|
|
41
41
|
verifyToken(token: string): Promise<VerifyTokenResponse>;
|
|
42
|
-
|
|
42
|
+
setSession(auth: {
|
|
43
|
+
accessToken?: string;
|
|
44
|
+
refreshToken?: string;
|
|
45
|
+
user?: User;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
getAccessToken(): Promise<string | null>;
|
|
48
|
+
getRefreshToken(): Promise<string | null>;
|
|
43
49
|
getUser(): Promise<User | null>;
|
|
44
50
|
isAuthenticated(): Promise<boolean>;
|
|
45
51
|
}
|
package/dist/client.js
CHANGED
|
@@ -169,6 +169,12 @@ class FederatedAuthClient {
|
|
|
169
169
|
await this.storage.setItem('user', JSON.stringify(auth.user));
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
async getAccessToken() {
|
|
173
|
+
return this.storage.getItem('accessToken');
|
|
174
|
+
}
|
|
175
|
+
async getRefreshToken() {
|
|
176
|
+
return this.storage.getItem('refreshToken');
|
|
177
|
+
}
|
|
172
178
|
async getUser() {
|
|
173
179
|
const userStr = await this.storage.getItem('user');
|
|
174
180
|
if (userStr) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -196,7 +196,7 @@ export interface LoginRequest {
|
|
|
196
196
|
email?: string;
|
|
197
197
|
id?: string;
|
|
198
198
|
password?: string;
|
|
199
|
-
appKey
|
|
199
|
+
appKey?: string;
|
|
200
200
|
rememberMe?: boolean;
|
|
201
201
|
}
|
|
202
202
|
export interface RegisterRequest {
|
|
@@ -204,7 +204,7 @@ export interface RegisterRequest {
|
|
|
204
204
|
password?: string;
|
|
205
205
|
name?: string;
|
|
206
206
|
surname?: string;
|
|
207
|
-
appKey
|
|
207
|
+
appKey?: string;
|
|
208
208
|
gender?: Gender;
|
|
209
209
|
dateOfBirth?: string;
|
|
210
210
|
phoneNumbers?: PhoneNumber[];
|
|
@@ -218,11 +218,11 @@ export interface RegisterRequest {
|
|
|
218
218
|
}
|
|
219
219
|
export interface GoogleAuthRequest {
|
|
220
220
|
googleToken: string;
|
|
221
|
-
appKey
|
|
221
|
+
appKey?: string;
|
|
222
222
|
}
|
|
223
223
|
export interface FacebookAuthRequest {
|
|
224
224
|
facebookToken: string;
|
|
225
|
-
appKey
|
|
225
|
+
appKey?: string;
|
|
226
226
|
}
|
|
227
227
|
export interface ForgotPasswordRequest {
|
|
228
228
|
email: string;
|