Skip to content
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

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

liangfung
Copy link
Collaborator

Relates #1675
Use 'queryMe'

@@ -271,7 +254,6 @@ function useSignOut(): () => Promise<void> {
}

interface User {
Copy link
Member

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

Copy link
Collaborator Author

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.

ee/tabby-ui/app/(dashboard)/components/sidebar.tsx Outdated Show resolved Hide resolved
@@ -270,8 +253,7 @@ function useSignOut(): () => Promise<void> {
}
}

interface User {
isAdmin: boolean
interface IJwtPayload {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface IJwtPayload {
interface JwtPayload {

Prefer stating type directly, without I prefix

@liangfung liangfung marked this pull request as ready for review March 18, 2024 04:31
@wsxiaoys wsxiaoys merged commit 65a51fa into main Mar 19, 2024
4 checks passed
@wsxiaoys wsxiaoys deleted the feat-ui-check-admin branch March 19, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants