wirejs-deploy-amplify-basic 0.0.41 → 0.0.43
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.
|
@@ -20,6 +20,15 @@ const backend = defineBackend({
|
|
|
20
20
|
/**
|
|
21
21
|
* Amplify resource augmentations
|
|
22
22
|
*/
|
|
23
|
+
backend.auth.resources.cfnResources.cfnUserPool.policies = {
|
|
24
|
+
passwordPolicy: {
|
|
25
|
+
minimumLength: 8,
|
|
26
|
+
requireLowercase: false,
|
|
27
|
+
requireNumbers: false,
|
|
28
|
+
requireSymbols: false,
|
|
29
|
+
requireUppercase: false,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
23
32
|
const userPoolClient = backend.auth.resources.cfnResources.cfnUserPoolClient;
|
|
24
33
|
userPoolClient.explicitAuthFlows = userPoolClient.explicitAuthFlows || [];
|
|
25
34
|
userPoolClient.explicitAuthFlows.push(
|
|
@@ -279,31 +279,14 @@ export class AuthenticationService extends AuthenticationServiceBase {
|
|
|
279
279
|
const command = new ConfirmSignUpCommand({
|
|
280
280
|
ClientId,
|
|
281
281
|
Username: email,
|
|
282
|
-
ConfirmationCode: form.inputs.code
|
|
282
|
+
ConfirmationCode: form.inputs.code,
|
|
283
283
|
});
|
|
284
284
|
const result = await client.send(command);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
USERNAME: email
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
const signinResult = await client.send(signinCommand);
|
|
294
|
-
signinResult.AuthenticationResult?.AccessToken;
|
|
295
|
-
const jwtPayload = jose.decodeJwt(
|
|
296
|
-
// assuming for now, until we support challenges like OTP, Email code, etc.
|
|
297
|
-
signinResult.AuthenticationResult?.IdToken);
|
|
298
|
-
await this.#cookie.write(cookies, {
|
|
299
|
-
state: 'authenticated',
|
|
300
|
-
user: {
|
|
301
|
-
id: jwtPayload.sub,
|
|
302
|
-
displayName: email,
|
|
303
|
-
username: email,
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
return this.getMachineState(cookies);
|
|
285
|
+
await this.#cookie.clear(cookies);
|
|
286
|
+
return {
|
|
287
|
+
...await this.getMachineState(cookies),
|
|
288
|
+
message: 'All done setting up!<br />Give it a try by signing in.'
|
|
289
|
+
};
|
|
307
290
|
}
|
|
308
291
|
catch (error) {
|
|
309
292
|
return {
|
|
@@ -478,7 +461,7 @@ export class AuthenticationService extends AuthenticationServiceBase {
|
|
|
478
461
|
user: undefined,
|
|
479
462
|
});
|
|
480
463
|
return {
|
|
481
|
-
...this.getMachineState(cookies),
|
|
464
|
+
...await this.getMachineState(cookies),
|
|
482
465
|
message: `Password set. Please try signing in with your new password.`
|
|
483
466
|
};
|
|
484
467
|
}
|