Skip to content

skip motd in UI if request initiated from tsh headless auth#31050

Merged
flyinghermit merged 5 commits intomasterfrom
sshah/skip-motd-for-headless
Aug 29, 2023
Merged

skip motd in UI if request initiated from tsh headless auth#31050
flyinghermit merged 5 commits intomasterfrom
sshah/skip-motd-for-headless

Conversation

@flyinghermit
Copy link
Copy Markdown
Contributor

When login in Web UI is initiated for headless auth, for example with authentication link generated by tsh --headless command:

Complete headless authentication in your local web browser:

https://<proxy>/web/headless/c7bd5f24-d487-5dd4-b30e-371a80bd5993

opening the link in browser redirects to login page with the following redirect format:
https://<proxy>/web/login?redirect_uri=https://<proxy>/web/headless/c7bd5f24-d487-5dd4-b30e-371a80bd5993

To disable MOTD when auth is initiated from headless auth, now we set showMotd = false if login url includes redirect_uri and the redirect_uri includes headless.

Tested with both local user and Github user configured with Github auth.

closes #28746

@flyinghermit
Copy link
Copy Markdown
Contributor Author

FYI @zmb3, I have manually tested this and it seems to do the trick. Tested with both local user account and for user connected with Github auth. LMK if there's other scenario I may have missed.

Comment thread web/packages/teleport/src/Login/useLogin.ts Outdated
Comment thread web/packages/teleport/src/Login/useLogin.ts
Comment thread web/packages/teleport/src/Login/useLogin.ts Outdated
- rename redirect_uri to redirectUri
- add explicit default showMotd type and setShowMotd return type
Comment thread web/packages/teleport/src/Login/Login.test.tsx Outdated
Comment thread web/packages/teleport/src/Login/useLogin.ts
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from kimlisa August 29, 2023 18:46
@flyinghermit flyinghermit added this pull request to the merge queue Aug 29, 2023
Merged via the queue into master with commit 8b2dcb9 Aug 29, 2023
@flyinghermit flyinghermit deleted the sshah/skip-motd-for-headless branch August 29, 2023 21:25
@public-teleport-github-review-bot
Copy link
Copy Markdown

@sshahcodes See the table below for backport results.

Branch Result
branch/v12 Create PR
branch/v13 Create PR
branch/v14 Failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip motd in UI when redirected from tsh

3 participants