Skip to content

Commit 9b21164

Browse files
authored
fix: prevent panic when signing keys (#4812)
2 parents 8fe996e + d9a824c commit 9b21164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/config/apikeys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (a *auth) generateAPIKeys() error {
7474

7575
func (a auth) generateJWT(role string) (string, error) {
7676
claims := CustomClaims{Issuer: "supabase-demo", Role: role}
77-
if len(a.SigningKeysPath) > 0 {
77+
if len(a.SigningKeysPath) > 0 && len(a.SigningKeys) > 0 {
7878
claims.ExpiresAt = jwt.NewNumericDate(time.Now().Add(time.Hour * 24 * 365 * 10)) // 10 years
7979
return GenerateAsymmetricJWT(a.SigningKeys[0], claims)
8080
}

0 commit comments

Comments
 (0)