1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-16 02:36:12 +00:00

feat: add static api key env variable (#1229)

This commit is contained in:
Elias Schneider
2026-01-11 15:36:27 +01:00
committed by GitHub
parent 9ca3d33c88
commit 746aa71d67
6 changed files with 78 additions and 6 deletions

View File

@@ -125,7 +125,9 @@ func (s *UserSignUpService) SignUpInitialAdmin(ctx context.Context, signUpData d
}()
var userCount int64
if err := tx.WithContext(ctx).Model(&model.User{}).Count(&userCount).Error; err != nil {
if err := tx.WithContext(ctx).Model(&model.User{}).
Where("id != ?", staticApiKeyUserID).
Count(&userCount).Error; err != nil {
return model.User{}, "", err
}
if userCount != 0 {