-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(authenticator): propagate username from signUp actor to top level machine #4923
Conversation
🦋 Changeset detectedLatest commit: efa1407 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -18,15 +18,13 @@ const logger = new Logger('SetupTotp-logger'); | |||
|
|||
// `facade` is manually typed to `UseAuthenticator` for temporary type safety. | |||
const facade: UseAuthenticator = useAuthenticator(); | |||
const { updateForm, submitForm, toSignIn } = facade; | |||
const { error, isPending, QRFields, totpSecretCode, username } = toRefs(facade); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QRFields
, totpSecretCode
, username
are static values and do not require reactivity
const totpCodeURL = totpSecretCode.value | ||
? getTotpCodeURL(totpIssuer, totpUsername!, totpSecretCode.value) | ||
: null; | ||
// `totpSecretCode` is typed as `string | null` but will always be populated by the machine here | ||
const totpCodeURL = getTotpCodeURL(totpIssuer, totpUsername, totpSecretCode!); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truthiness check of totpSecretCode.value
is no longer needed. Before migrating to [email protected]
the totpSecretCode
value needed to be generated by an additional async call, this check was a remnant of the previously required handling.
totpSecretCode
is now provided directly via the state machine from the payload of a successful call to signIn
, signUp
, or confirmSignUp
depending on the end user's current account status
Description of changes
Fix Setup Totp
route
QR code rendering in Vue and computedtotpCodeUrl
values used in Vue, Angular, and ReactAuthenticator
implementationsusername
to top level machine fromsignUpActor.resolved
statesetup-totp.vue
setup-totp.spec.ts
Issue #, if available
Fixes #4919
Description of how you validated changes
username
value is read correctly from the QR code using a QR code readerChecklist
yarn test
passes and tests are updated/addedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.