Add last used at to personal api key

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-01-05 16:46:13 +01:00
parent cf72beaba4
commit 71263367f6
11 changed files with 108 additions and 20 deletions

View File

@@ -66,6 +66,13 @@ func (s *APIKeyService) GetAPIKey(ctx context.Context, keyID gid.GID) (*coredata
return NewPersonalAPIKeyExpiredError(keyID)
}
apiKey.LastUsedAt = &now
apiKey.UpdatedAt = now
if err := apiKey.Update(ctx, tx); err != nil {
return fmt.Errorf("cannot update personal api key last used at: %w", err)
}
return nil
},
)