-
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
feat(ui): check admin status via service instead of JWT #1688
Conversation
ee/tabby-ui/lib/tabby/auth.tsx
Outdated
@@ -271,7 +254,6 @@ function useSignOut(): () => Promise<void> { | |||
} | |||
|
|||
interface User { |
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.
nit: rename this to something like JWTPayload
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.
Used IJwtPayload
to differentiate from the jwtPayload
exported by jwt-decode
.
Co-authored-by: Meng Zhang <[email protected]>
ee/tabby-ui/lib/tabby/auth.tsx
Outdated
@@ -270,8 +253,7 @@ function useSignOut(): () => Promise<void> { | |||
} | |||
} | |||
|
|||
interface User { | |||
isAdmin: boolean | |||
interface IJwtPayload { |
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.
interface IJwtPayload { | |
interface JwtPayload { |
Prefer stating type directly, without I
prefix
Relates #1675
Use 'queryMe'