Skip to content

Commit 569f25e

Browse files
committed
enhanced auth
1 parent c6d0cf1 commit 569f25e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/translator/oauth.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ func (c *Config) updateAuth(ctx context.Context) error {
2020
if res := c.repository.RSA; res != "" {
2121
c.ensureJWTValidator(cfg)
2222
cfg.JWTValidator.RSA = getScyResource(res)
23+
if cfg.JwtSigner == nil {
24+
cfg.JwtSigner = &signer.Config{}
25+
}
26+
cfg.JwtSigner.RSA = getScyResource(res)
2327
}
2428

2529
if res := c.repository.HMAC; res != "" {
@@ -28,7 +32,9 @@ func (c *Config) updateAuth(ctx context.Context) error {
2832
if cfg.JwtSigner == nil {
2933
cfg.JwtSigner = &signer.Config{}
3034
}
31-
cfg.JwtSigner.HMAC = getScyResource(res)
35+
if cfg.JwtSigner.RSA == nil { //prioritize RSA over HMAC
36+
cfg.JwtSigner.HMAC = getScyResource(res)
37+
}
3238
}
3339

3440
if res := c.repository.Firebase; res != "" {

0 commit comments

Comments
 (0)