chore: add more info to auth

This commit is contained in:
xkm
2026-04-07 22:04:40 +08:00
parent 1aecb4424c
commit a6673fda2a
2 changed files with 13 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ func (s *Service) VerifyUser(ctx context.Context, input VerifyUserInput) (Verify
claims["userid"] = u.ID.String()
claims["username"] = u.Username
claims["role"] = u.Role
claims["display_name"] = u.DisplayName
claims["account_status"] = u.AccountStatus
jwtauth.SetExpiryIn(claims, 24*time.Hour)
jwtauth.SetIssuedNow(claims)
@@ -40,5 +41,6 @@ func (s *Service) VerifyUser(ctx context.Context, input VerifyUserInput) (Verify
UserName: u.Username,
DisplayName: u.DisplayName,
Role: u.Role,
AccountStatus: u.AccountStatus,
}, nil
}

View File

@@ -219,6 +219,7 @@ type VerifyUserResult struct {
UserName string `json:"user_name"`
DisplayName string `json:"display_name"`
Role string `json:"role"`
AccountStatus string `json:"account_status"`
}
type AuthService interface {