"Encountering a Heroku error due to an oversized cookie while using Express.js and

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.

Answer №1

The problem has been resolved; it was determined that the passport-discord module unexpectedly passes all information through cookies.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips on embedding a textField into a designated row within a table by clicking a button with the help of reactjs and material ui

I need assistance adding multiple text fields to a specific row within a table when a designated row's "add" button is clicked. Currently, I am able to add a text field when the button is clicked, but it adds the text field to every row in the table. ...

Steps for generating tab panels and their respective content using a v-for loop

I am currently utilizing Vue 3 in combination with Bootstrap 5. My objective is to incorporate multiple Tabpanels within a v-for. Each of these Tabs should feature distinct content. To achieve this, I attempted placing my Tabs and their respective Conten ...

Troubleshooting Console.log not functioning properly within a Dockerized environment running a Node.js and Express application

I created a Node.js application using a Docker container and the provided Dockerfile looks like this: FROM node:carbon WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 CMD [ "npm", "start" ] My issue is that when I try ...

Learning to control the JavaScript countdown clock pause and play functionality

How can I control the countdown timer to play and pause, allowing me to resume at the exact time it was paused? At the start, the timer is set to play. Please keep in mind that the button appears empty because the font-awesome package was not imported, b ...

JavaScript code for validating two passwords is malfunctioning

I'm currently working on a registration form for my website and I'm trying to implement a JS script that compares two password inputs (password and repeat password) and displays a message saying "passwords are not the same." Below is the code I h ...

Issue with jQuery: Changes are not being triggered and clicks are also not working

I managed to recreate the modifications of my complex script in a simple jsfiddle, which can be found here. Below is the code I am working with locally: HTML <input type="text" id="rangeStart" value="updateMe" /><br/> <input type="text" c ...

Real-Time Chat Update Script

Recently, I've been delving into PHP and attempting to create a live chat web application. The data for the chat is stored in a MySQL database, and I have written a function called UpdateDb() that refreshes the chat content displayed in a certain div ...

An HTML button generated by a .js file is able to execute a .js function without any issues, but it inadvertently removes all .css styling

Currently grappling with an issue in my JavaScript self-teaching journey that I can't seem to resolve or find examples for. The problem at hand: When the HTML button calls a .js function, it successfully executes the function but also wipes out all C ...

Using jQuery's .load() method is like including a file in a

Currently, Im working on revamping a company website that comes equipped with its very own CMS. Unfortunately, we are restricted from accessing the server configuration and FTP, which means I am limited to running only client-side files like HTML/CSS/J ...

What is the best way to make an ajax commenting system function from a separate directory?

I am facing an issue with implementing an ajax commenting system on my website. When I place all the code from the /comment directory directly in the root, everything works fine and the commenting system functions as expected on new pages. However, when I ...

Is there a way to mimic disabled input fields?

Is there a way to simulate input being disabled without actually changing the value in the input field, but still have that value sent with POST using a form? <input class="dis" type="text" disabled="disabled" value="111"> <input class="no" type= ...

Wait until the user submits the form before activating Angular validations, and do not display any validation messages if the user deletes text from a text box

I am looking to implement angular validations that are only triggered after the user clicks on submit. I want the validations to remain hidden if the user removes text from a textbox after submitting it. Here is what I need: - Validations should not be dis ...

Node.js Express sends incorrect headers

My server has the ability to modify response headers based on request headers and then send a file to the client. For example, app.get('/*', (req, res) => { headers = {}; if ("some_key" in req.headers) { headers["another_key"] = "some_ ...

What are the steps for implementing responsive design animation in my particular scenario?

Can someone please help me with a strange bug in Chrome? I am trying to create a responsive design for my app. The width of the 'item' element should change based on the browser's width. It works fine when the page first loads in Chrome, b ...

Unlocking the express routes of one docker container from another docker container

Currently, I am developing a microservice that consists of approximately 5 services. Each service operates within its own container, meaning they each have unique IP addresses and individual databases. While each service works flawlessly on its own, my cha ...

pressing the downward arrow does not cause the number to decrease

I'm facing an issue with my code in this video. The increment is working when the upward arrow is clicked, but not the decrement. I suspect there's a problem with the jQuery code. Initially, I tried modifying from top to bottom, and changing +1 t ...

Developing Vue applications with dynamic component insertion

Looking to develop a user-friendly form builder using Vue, where users can easily add different form fields by clicking buttons from a menu. If I only had one type of form field to add, it could be done like this (https://jsfiddle.net/u6j1uc3u/32/): <d ...

Passing onClick event to parent component during iteration in ReactJS

I am facing a challenge where I need to remove a row from a table upon a click event. I have managed to create an iteration and display a delete button, but I am struggling with passing the onClick event from the parent component to the child component in ...

Alter the color of textbox text using JavaScript

I have a text input field. When clicked, I want to change the text color style using JavaScript. Previously, I successfully achieved clearing the inner content of the textbox when clicked and reverting to the default version on blur. This code is currently ...

What is the best way to fetch the title property from my Campaign Contract for displaying it in the render method?

I'm currently working on a unique crowdfunding DApp that requires constant access to contract variables through function calls for retrieval purposes. The getDeployedCampaigns function is responsible for returning an array of deployed campaign addres ...