We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d89ac51 commit 6e82481Copy full SHA for 6e82481
internal/api/oidc_redirect.go
@@ -339,7 +339,14 @@ func OIDCRedirect(router *gin.RouterGroup) {
339
sess.SetAuthID(user.AuthID, provider.Issuer())
340
sess.SetUser(user)
341
sess.SetGrantType(authn.GrantAuthorizationCode)
342
- sess.IdToken = tokens.IDToken
+
343
+ // Ensure that the ID token fits into the existing
344
+ // database column; otherwise, truncate it.
345
+ if n := len(tokens.IDToken); n > 2048 {
346
+ sess.IdToken = tokens.IDToken[:2048]
347
+ } else {
348
+ sess.IdToken = tokens.IDToken
349
+ }
350
351
// Set session expiration and timeout.
352
sess.SetExpiresIn(unix.Day)
0 commit comments