feat(ui): Add tenant info

This commit is contained in:
wizardchen
2025-09-16 15:39:34 +08:00
committed by lyingbug
parent e08ccb286c
commit 2495d7c084
8 changed files with 637 additions and 54 deletions
+2 -2
View File
@@ -399,10 +399,10 @@ func (s *userService) RevokeToken(ctx context.Context, tokenString string) error
// GetCurrentUser gets current user from context
func (s *userService) GetCurrentUser(ctx context.Context) (*types.User, error) {
userID, ok := ctx.Value("user_id").(string)
user, ok := ctx.Value("user").(*types.User)
if !ok {
return nil, errors.New("user not found in context")
}
return s.userRepo.GetUserByID(ctx, userID)
return user, nil
}