-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Web] Hide access request promoted notification quick action button if the user is already part of the access list #51276
Conversation
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.
This fix is a bit hacky, but I guess we don't have a way to tell if a user gained the access, right?
web/packages/teleport/src/services/storageService/storageService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/services/storageService/storageService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/components/Authenticated/Authenticated.tsx
Outdated
Show resolved
Hide resolved
@gzdunek Yes, I had explored other ways to try to actually determine whether the access list was active, but there was no way to without surfacing lots of information about the session and touching lots of related code, which I figured was not worth it for a small UX bug. The issue is that while it's possible and quite easy to know when the user has been added to the access list (for example by making a request to fetch access lists), it's not possible to know whether or not those new permissions have been applied to their current web session and certificate. Keeping track of login time seemed the most straightforward way which works as intended and doesn't introduce any risk for regressions. |
web/packages/teleport/src/services/storageService/storageService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/services/storageService/storageService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/services/storageService/storageService.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/components/Authenticated/Authenticated.tsx
Outdated
Show resolved
Hide resolved
…asn't assumed access list yet
db0fec0
to
49adc20
Compare
Purpose
e
counterpart: https://github.com/gravitational/teleport.e/pull/5893This PR fixes a UX bug which caused users to still see the "Log in again to gain access" button on their access request promoted notification even if they had already done so.
The logic simply works by keeping track of when the user logged in, if they logged in before the access request was promoted, then they will be shown the button to log in again.
Demo
fix.access.list.ux.mov