mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-12 21:58:58 -04:00
fix: oidc middleware claim race
This commit is contained in:
1 parent
8504e29743
commit
cd7f8f91b6
1 file changed
+8
-6
@@ -104,13 +104,15 @@ func (m *OIDCAuthenticator) getClaims(token string, req *http.Request) (map[stri
|
||||
expiration := m.extractExpiration(aClaims)
|
||||
// always set an exp claim
|
||||
claims["exp"] = expiration.Unix()
|
||||
go func() {
|
||||
d, err := msgpack.Marshal(claims)
|
||||
if err != nil {
|
||||
m.Logger.Error().Err(err).Msg("failed to marshal claims for userinfo cache")
|
||||
return
|
||||
}
|
||||
|
||||
d, err := msgpack.Marshal(claims)
|
||||
if err != nil {
|
||||
m.Logger.Error().Err(err).Msg("failed to marshal claims for userinfo cache")
|
||||
|
||||
return claims, true, nil
|
||||
}
|
||||
|
||||
go func() {
|
||||
err = m.userInfoCache.Write(&store.Record{
|
||||
Key: encodedHash,
|
||||
Value: d,
|
||||
|
||||
Reference in new issue
Block a user