-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
- Render input and login elements based on isLocalAuthEnabled flag - Render error message if local auth is disabled but no SSO provider is configured
/> | ||
{otpEnabled && ( | ||
<Flex flexDirection="row"> | ||
{!isLocalAuthEnabled && !ssoEnabled && ( |
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 need for this error here (why error btw?).
For now, lets do nothing in this case. We will add a text placeholder for the empty state in another PR.
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 must've misunderstood our communication.
removed
packages/teleport/src/config.js
Outdated
@@ -102,6 +102,10 @@ const cfg = { | |||
return cfg.auth ? cfg.auth.second_factor : null; | |||
}, | |||
|
|||
getLocalAuthFlag() { | |||
return cfg.auth && cfg.auth.localAuth ? cfg.auth.localAuth : true; |
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.
Lets add a default value to config.js for this property and then
return cfg.auth.localAuth;
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.
revised
expect(getByText(/github/i)).toBeInTheDocument(); | ||
expect(getByText(/google/i)).toBeInTheDocument(); | ||
|
||
expect(queryByText(/username/i)).not.toBeInTheDocument(); | ||
expect(queryByText(/password/i)).not.toBeInTheDocument(); | ||
expect(queryByText(/two factor token/i)).not.toBeInTheDocument(); | ||
expect(queryByText(/login/i)).not.toBeInTheDocument(); |
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.
Lets test the rendering part using snapshot testing by creating FormLogin.story.test.js
. You can check out the FormInvite.story.test.js
for example.
And lets keep only functional tests inside FormLogin.test.js
(this is when we test login click callbacks, etc).
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.
revised
Congrats on your Teleport Feature PR @kimlisa 🎉 My one observation, would be that in this case.. we should change the copy, since a header to instruct people to 'Sign into Teleport' is inaccurate. I would propose a better and more friendly user message would be replace Sign into Teleport with
I know this is close, let me know if I should create this as a new ticket in Teleport or if you would like this issue created here? |
@benarent I think Alexey wanted this to be another PR. Pinging @alex-kovoy |
…/deployment-updates * 'master' of github.com:gravitational/webapps: (27 commits) [teleport] Receive and display nodeCount and publicURL in cluster table (#52) Remove unused imports from makeEvent.ts Typescript migration (#51) [Teleport] Prompt user with a confirmation window for session tabs (#49) Refactor tabs creation to a separate hook and add unit-tests (#50) Do not rerender in-active document (#47) regenerate dist files New Terminal (#46) Unit test rest of Dialog*.jsx and TopNav*.jsx (#45) Read localAuthEnabled config from backend (#44) Unit Test Popover (#43) Unit test teleport/Login (#40) closes #39 Test rendering of SideNav, SideNavItem, SideNavItemIcon (#41) Unit test featureBase (#38) Unit test useStore (#37) Unit test FormPassword (#36) Unit test FormLogin (#35) Unit test FieldSelect (#34) Test useRule unsubscribe behavior and some cleanup (#33) Unit test FieldInput (#32) ...
Fixes issue gravitational/teleport#2789
Part of PR gravitational/teleport#3412
teleport/config
to getgetLocalAuth
flag. Set to default true.Login.jsx
gets and sets theisLocalAuthEnabled
propFormLogin.jsx
receivesisLocalAuthEnabled
prop (defaulted to true)FormLogin.test.js
Various states in FormLogin:
If local auth is disabled, only SSO providers are rendered:
If local auth is disabled, but no SSO providers are provided:
If local auth is enabled (default) and SSO providers are provided, renders everything: