Being unsure of the exact cause, I am encountering an issue with Heroku that gives me the error message
t=error code=H25 desc="HTTP restriction: oversized cookie"
whenever I attempt to authenticate myself with Discord OAuth. Interestingly, this problem only occurs with specific Discord accounts while most other accounts are able to log in without any issues.
I have tried various solutions such as reducing the number of modules used with express.js and minimizing the amount of information needed from Discord OAuth, but none of them seem to resolve the problem. It appears to be related to a specific error with certain Discord accounts, however, I cannot pinpoint the exact source of the issue.
Below is a snippet of my server code:
app.use(express.static(__dirname + "/public"));
//app.use(apiLimiter);
app.use(helmet());
//app.use(sslRedirect());
app.use(session({
secret: 'sdfhbw45',
resave: false,
saveUninitialized: false,
cookie: {
path: '/',
secure: true,
httpOnly: true,
domain : '.ryuwon.dev',
}
}));
app.use(passport.initialize());
app.use(passport.session());
passport.use(new Strategy({
clientID: 'y',
clientSecret: 'x',
callbackURL: `https://ssx.ryuwon.dev/callback`,
scope: scopes
}, function(accessToken, refreshToken, profile, done) {
process.nextTick(function() {
return done(null, profile);
});
}));
I am utilizing passport-discord for my Discord authentication. Any assistance on resolving this issue would be greatly appreciated. Unfortunately, there is limited information available online regarding how to fix this problem, especially when it pertains to specific user accounts causing the error during authentication.