diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-29 03:06:44 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-29 03:06:44 +0900 |
| commit | 19b19e7f48d6375806f827713a98cffd2c57a434 (patch) | |
| tree | 5b68e70a65a2434517c7e1ea5ea330fd686049d4 /backend/auth/jwt.go | |
| parent | d1c8aa42aec32c8b042ae32d249df9c3c969453d (diff) | |
| download | iosdc-japan-2025-albatross-19b19e7f48d6375806f827713a98cffd2c57a434.tar.gz iosdc-japan-2025-albatross-19b19e7f48d6375806f827713a98cffd2c57a434.tar.zst iosdc-japan-2025-albatross-19b19e7f48d6375806f827713a98cffd2c57a434.zip | |
refactor(backend): enable emit_pointers_for_null_types in sqlc
Diffstat (limited to 'backend/auth/jwt.go')
| -rw-r--r-- | backend/auth/jwt.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/backend/auth/jwt.go b/backend/auth/jwt.go index c15fc01..0b92155 100644 --- a/backend/auth/jwt.go +++ b/backend/auth/jwt.go @@ -19,15 +19,11 @@ type JWTClaims struct { } func NewJWT(user *db.User) (string, error) { - var iconPath *string - if user.IconPath.Valid { - iconPath = &user.IconPath.String - } claims := &JWTClaims{ UserID: int(user.UserID), Username: user.Username, DisplayName: user.DisplayName, - IconPath: iconPath, + IconPath: user.IconPath, IsAdmin: user.IsAdmin, RegisteredClaims: jwt.RegisteredClaims{ ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24)), |
