@alore/auth-react-sdk 1.0.2-alpha → 1.0.4-alpha
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/types.d.ts +4 -2
- package/dist/utils/AloreAuth.d.ts +7 -4
- package/dist/utils/AloreAuth.js +4 -3
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ export type KeyDerivationFunction = 'argon2d' | 'pbkdf2';
|
|
|
13
13
|
* @property requireUsername - Optional boolean to require username.
|
|
14
14
|
* @property passwordMinLength - Optional number for password minimum length.
|
|
15
15
|
* @property enablePasskeys - Optional boolean to enable passkeys.
|
|
16
|
+
* @property enablePasswords - Optional boolean to enable passwords.
|
|
16
17
|
* @property socialLoginEnabled - Optional boolean to enable social login.
|
|
17
18
|
* @property privacyPolicyUrl - Optional string for privacy policy URL.
|
|
18
19
|
* @property termsOfServiceUrl - Optional string for terms of service URL.
|
|
19
20
|
* @property logoUrl - Optional string for logo URL.
|
|
20
21
|
* @property socialProviders - Optional social login providers.
|
|
22
|
+
* @property enableWalletCreation - Optional boolean to enable wallet creation.
|
|
21
23
|
*/
|
|
22
24
|
export interface AuthProviderConfig {
|
|
23
25
|
rpDomain?: string;
|
|
@@ -33,6 +35,7 @@ export interface AuthProviderConfig {
|
|
|
33
35
|
termsOfServiceUrl?: string;
|
|
34
36
|
logoUrl?: string;
|
|
35
37
|
socialProviders?: SocialProvider[];
|
|
38
|
+
enableWalletCreation?: boolean;
|
|
36
39
|
}
|
|
37
40
|
export interface AuthMachineContext {
|
|
38
41
|
authProviderConfigs?: AuthProviderConfig;
|
|
@@ -92,11 +95,10 @@ export interface ForgeData {
|
|
|
92
95
|
}
|
|
93
96
|
export interface SocialProvider {
|
|
94
97
|
id: string;
|
|
95
|
-
authProviderConfigId: string;
|
|
96
98
|
providerName: string;
|
|
97
99
|
clientId: string;
|
|
98
100
|
enabled?: boolean;
|
|
99
|
-
createdAt
|
|
101
|
+
createdAt?: string;
|
|
100
102
|
updatedAt?: string;
|
|
101
103
|
}
|
|
102
104
|
export {};
|
|
@@ -219,7 +219,10 @@ export declare class AloreAuth {
|
|
|
219
219
|
}) => Promise<ForgeData>;
|
|
220
220
|
googleLogin: (_: AuthMachineContext, event: {
|
|
221
221
|
type: 'GOOGLE_LOGIN';
|
|
222
|
-
|
|
222
|
+
payload: {
|
|
223
|
+
accessToken: string;
|
|
224
|
+
providerName: string;
|
|
225
|
+
};
|
|
223
226
|
}) => Promise<{
|
|
224
227
|
googleOtpCode: any;
|
|
225
228
|
salt: any;
|
|
@@ -230,10 +233,10 @@ export declare class AloreAuth {
|
|
|
230
233
|
};
|
|
231
234
|
sessionId: any;
|
|
232
235
|
isNewUser?: undefined;
|
|
233
|
-
|
|
236
|
+
socialProviderRegisterUser?: undefined;
|
|
234
237
|
} | {
|
|
235
238
|
isNewUser: boolean;
|
|
236
|
-
|
|
239
|
+
socialProviderRegisterUser: {
|
|
237
240
|
email: any;
|
|
238
241
|
nickname: any;
|
|
239
242
|
salt: any;
|
|
@@ -248,7 +251,7 @@ export declare class AloreAuth {
|
|
|
248
251
|
googleUser?: undefined;
|
|
249
252
|
sessionId?: undefined;
|
|
250
253
|
isNewUser?: undefined;
|
|
251
|
-
|
|
254
|
+
socialProviderRegisterUser?: undefined;
|
|
252
255
|
}>;
|
|
253
256
|
verifyGoogleLogin: (context: AuthMachineContext, event: {
|
|
254
257
|
type: 'COMPLETE_GOOGLE_SIGN_IN';
|
package/dist/utils/AloreAuth.js
CHANGED
|
@@ -391,14 +391,15 @@ export class AloreAuth {
|
|
|
391
391
|
}),
|
|
392
392
|
// Google login flow
|
|
393
393
|
googleLogin: (_, event) => __awaiter(this, void 0, void 0, function* () {
|
|
394
|
-
const {
|
|
394
|
+
const { accessToken, providerName } = event.payload;
|
|
395
395
|
const response = yield this.fetchWithProgressiveBackoff('/auth/v1/google-login', {
|
|
396
396
|
method: 'POST',
|
|
397
397
|
headers: {
|
|
398
398
|
'Content-Type': 'application/json',
|
|
399
399
|
},
|
|
400
400
|
body: JSON.stringify({
|
|
401
|
-
accessToken
|
|
401
|
+
accessToken,
|
|
402
|
+
provider: providerName,
|
|
402
403
|
}),
|
|
403
404
|
});
|
|
404
405
|
const data = yield response.json();
|
|
@@ -417,7 +418,7 @@ export class AloreAuth {
|
|
|
417
418
|
if (response.status === 404) {
|
|
418
419
|
return {
|
|
419
420
|
isNewUser: true,
|
|
420
|
-
|
|
421
|
+
socialProviderRegisterUser: {
|
|
421
422
|
email: data.email,
|
|
422
423
|
nickname: data.nickname,
|
|
423
424
|
salt: data.salt,
|