-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Auth/PM-8113 - 2FA Components Consolidation and UI Refresh #12087
base: main
Are you sure you want to change the base?
Conversation
…of UnauthenticatedExtensionUIRefresh flag
…ed import is used a dialog.
…s-ui-refresh + merge conflict fixes
Great job, no security vulnerabilities found in this Pull Request |
…ead of libs/angular/src/auth
…en top level page component and child components
…tor-auth and move all logic into single component - WIP
…s-ui-refresh + merge confliction resolution
…nt imports on other clients.
…ulLoginNavigate (3) after successful login we always loginEmailService.clearValues()
@rr-bw , I've added TDE offboarding support to the flows. |
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.
No platform changes, approving
libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html
Outdated
Show resolved
Hide resolved
libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts
Outdated
Show resolved
Hide resolved
apps/browser/src/auth/services/extension-two-factor-auth-component.service.ts
Show resolved
Hide resolved
ItemModule, | ||
IconModule, | ||
], | ||
providers: [], | ||
}) | ||
export class TwoFactorOptionsComponent implements OnInit { | ||
@Output() onProviderSelected = new EventEmitter<TwoFactorProviderType>(); | ||
@Output() onRecoverSelected = new EventEmitter(); |
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.
I don't think the onProviderSelected
and onRecoverSelected
outputs are actually being used in the new flow. Also, I'd think you can remove the concept of "recover" entirely from this component (and the TwoFactorOptionsDialogResult
enum) since the recovery code button is now being shown as an option directly on the 2FA screen. If I'm correct, address also the reference to TwoFactorOptionsDialogResult
in selectOtherTwoFactorMethod()
on TwoFactorAuthComponent
.
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.
Great catch.
4f25d11
Video of testing after changes:
https://github.com/user-attachments/assets/ce40c74c-9db2-4433-be1b-57014d41ed40
libs/auth/src/angular/two-factor-auth/two-factor-options.component.ts
Outdated
Show resolved
Hide resolved
libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts
Outdated
Show resolved
Hide resolved
libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html
Outdated
Show resolved
Hide resolved
…ectOtherTwofactorMethod to selectOtherTwoFactorMethod
}, | ||
"selectAnotherMethod": { | ||
"message": "Select another method", | ||
"desccription": "Select another two-step login method" |
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.
"desccription": "Select another two-step login method" | |
"description": "Select another two-step login method" |
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.
Oops! Thank you for catching that!
4376f0e
"sendVerificationCodeEmailAgain": { | ||
"message": "Send verification code email again" | ||
}, | ||
"useAnotherTwoStepMethod": { | ||
"message": "Use another two-step login method" | ||
}, | ||
"selectAnotherMethod": { | ||
"message": "Select another method", | ||
"desccription": "Select another two-step login method" |
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.
"desccription": "Select another two-step login method" | |
"description": "Select another two-step login method" |
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.
"sendVerificationCodeEmailAgain": { | ||
"message": "Send verification code email again" | ||
}, | ||
"useAnotherTwoStepMethod": { | ||
"message": "Use another two-step login method" | ||
}, | ||
"selectAnotherMethod": { | ||
"message": "Select another method", | ||
"desccription": "Select another two-step login method" |
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.
"desccription": "Select another two-step login method" | |
"description": "Select another two-step login method" |
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.
<path class="tw-fill-art-primary"" fill-rule="evenodd" | ||
d="M13.281 25.298h-3.68V23.81h3.68v1.488ZM19.907 25.298h-3.68V23.81h3.68v1.488Z" | ||
clip-rule="evenodd" /> | ||
<path stroke="#2CDDE9" stroke-width=".784" |
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.
art-accent
instead of hardcoded value
https://components.bitwarden.com/?path=/docs/component-library-icon--docs
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.
<path class="tw-fill-art-accent" | ||
d="M67.118 46.886a1.062 1.062 0 0 0-.138-.531 1.037 1.037 0 0 0-.381-.386 1.006 1.006 0 0 0-1.037.018 1.059 1.059 0 0 0-.324 1.46c.099.156.237.283.4.366v1.716a.48.48 0 0 0 .126.347.461.461 0 0 0 .333.147.446.446 0 0 0 .333-.147.482.482 0 0 0 .125-.347V47.81c.168-.086.31-.219.409-.382.099-.163.152-.35.154-.543Zm5.37-6.916h-.565a.337.337 0 0 1-.312-.215.358.358 0 0 1-.026-.133v-.255a5.896 5.896 0 0 0-1.374-3.901 5.645 5.645 0 0 0-3.567-1.972 5.4 5.4 0 0 0-2.268.263c-.73.248-1.4.65-1.97 1.181a5.634 5.634 0 0 0-1.332 1.896 5.75 5.75 0 0 0-.468 2.286v.413c0 .008-.03.434-.392.44h-.509a1.686 1.686 0 0 0-1.203.514c-.32.328-.498.772-.497 1.234v10.37c0 .463.178.907.497 1.234.318.328.75.515 1.203.518h12.783c.452-.003.884-.189 1.202-.517.319-.328.497-.772.497-1.234V41.721a1.776 1.776 0 0 0-.495-1.235 1.71 1.71 0 0 0-.552-.38 1.665 1.665 0 0 0-.653-.136h.001Zm-10.637-.85a4.442 4.442 0 0 1 .41-1.877 4.346 4.346 0 0 1 1.16-1.515 4.218 4.218 0 0 1 1.685-.855 4.17 4.17 0 0 1 1.881-.029 4.335 4.335 0 0 1 2.436 1.596c.61.8.934 1.79.918 2.806v.376a.358.358 0 0 1-.1.246.336.336 0 0 1-.24.102h-7.63a.468.468 0 0 1-.352-.115.51.51 0 0 1-.169-.336v-.399h.001Zm11.091 12.97a.477.477 0 0 1-.133.332.45.45 0 0 1-.322.139H59.705a.445.445 0 0 1-.323-.139.46.46 0 0 1-.132-.331V41.72a.474.474 0 0 1 .132-.331.456.456 0 0 1 .321-.138h12.784c.121 0 .237.05.322.138a.473.473 0 0 1 .133.33v10.37Z" /> | ||
</g> | ||
<path class="tw-fill-art-primary"" fill-rule="evenodd" |
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.
<path class="tw-fill-art-primary"" fill-rule="evenodd" | |
<path class="tw-fill-art-primary" fill-rule="evenodd" |
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.
clip-rule="evenodd" /> | ||
<path class="tw-fill-art-accent" | ||
d="M100.357 80.991a.382.382 0 0 0-.382-.382H73.651a.382.382 0 0 0 0 .765h26.324c.211 0 .382-.171.382-.383ZM65.693 77.56c-2.04-3.686-5.74-6.133-9.95-6.133-.895 0-1.766.11-2.602.319a.382.382 0 0 1-.184-.743 11.478 11.478 0 0 1 2.785-.341c4.52 0 8.46 2.627 10.618 6.528a14.09 14.09 0 0 1 1.563 4.503.382.382 0 1 1-.752.126 13.324 13.324 0 0 0-1.478-4.258Z" /> | ||
<path class="tw-fill-art-primary" fill-rule="evenodd" stroke="#020F66" stroke-width=".355" |
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.
art-primary
instead of hardcoded value
https://components.bitwarden.com/?path=/docs/component-library-icon--docs
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.
...twofactorRefactorSwap( | ||
TwoFactorComponent, | ||
...unauthUiRefreshSwap( | ||
TwoFactorComponentV1, | ||
AnonLayoutWrapperComponent, | ||
{ | ||
path: "2fa", | ||
}, | ||
{ | ||
path: "2fa", | ||
component: AnonLayoutWrapperComponent, |
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.
Can you check if we can avoid re-declaring AnonLayoutWrapperComponent
here? (line 87 and 93)
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.
Good catch, we can remove the inner component property but not the outer one: 1c8c9f4
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.
Do we need this empty file?
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.
No, I've removed it here: ac0b80f
…ary AnonLayoutWrapperComponent component property.
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-8113
Associated Server PR: bitwarden/server#5120
📔 Objective
To consolidate all the cross client 2FA components into single implementation components delegating all client specific logic into services while updating the UIs to match the new design.
This PR is unfortunately quite large, but a ton of the file changes are renames or moves.
📸 Screenshots
To avoid slowing down the PR loading massively, each of the below videos are linked using a thumbnail which downloads the videos instead of directly rendering them inline.
Web
Web - Standard MP Login Scenarios
Web - SSO Scenarios
Note: remember me does not currently work with SSO, but that is being addressed separately.
Desktop
Desktop - Standard MP Login Scenarios
Extension
Extension - Chrome - Standard MP Login Scenarios
Note: WebAuthn is now done inline in Chrome instead of in a new tab like we have to do for other Browsers until we rebuild the WebAuthn flows with better support.
Extension - Firefox - Standard MP Login Scenarios
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes