Skip to content

Commit 53dcf36

Browse files
committed
Refactor jwtutils to remove redundant key reader
1 parent 76561ac commit 53dcf36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/userauth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) {
169169

170170
//nolint:gocritic // We need to read the system signing key
171171
// in order to sign the token.
172-
token, err := jwtutils.Sign(dbauthz.AsKeyReader(ctx), api.OIDCConvertKeyCache, claims)
172+
token, err := jwtutils.Sign(ctx, api.OIDCConvertKeyCache, claims)
173173
if err != nil {
174174
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
175175
Message: "Internal error signing state jwt.",
@@ -1681,7 +1681,7 @@ func (api *API) convertUserToOauth(ctx context.Context, r *http.Request, db data
16811681

16821682
//nolint:gocritic // We need to read the system signing key
16831683
// in order to verify the token.
1684-
err = jwtutils.Verify(dbauthz.AsKeyReader(ctx), api.OIDCConvertKeyCache, jwtCookie.Value, &claims)
1684+
err = jwtutils.Verify(ctx, api.OIDCConvertKeyCache, jwtCookie.Value, &claims)
16851685
if xerrors.Is(err, cryptokeys.ErrKeyNotFound) || xerrors.Is(err, cryptokeys.ErrKeyInvalid) || xerrors.Is(err, jose.ErrCryptoFailure) {
16861686
// These errors are probably because the user is mixing 2 coder deployments.
16871687
return database.User{}, idpsync.HTTPError{

0 commit comments

Comments
 (0)