Skip to content

Commit 816e0c8

Browse files
committed
Add uk_ prefix for user key
1 parent f8738b0 commit 816e0c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/pkg/repositories/gorm_user_repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (repository *gormUserRepository) RotateAPIKey(ctx context.Context, userID e
7070
return tx.WithContext(ctx).Model(user).
7171
Clauses(clause.Returning{}).
7272
Where("id = ?", userID).
73-
Update("api_key", apiKey).Error
73+
Update("api_key", "uk_"+apiKey).Error
7474
},
7575
)
7676
if errors.Is(err, gorm.ErrRecordNotFound) {
@@ -219,7 +219,7 @@ func (repository *gormUserRepository) LoadOrStore(ctx context.Context, authUser
219219
user = &entities.User{
220220
ID: authUser.ID,
221221
Email: authUser.Email,
222-
APIKey: apiKey,
222+
APIKey: "uk_" + apiKey,
223223
SubscriptionName: entities.SubscriptionNameFree,
224224
CreatedAt: time.Now().UTC(),
225225
UpdatedAt: time.Now().UTC(),

0 commit comments

Comments
 (0)