Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iron-session: Bad usage. Password must be at least 32 characters long. #13

Open
pmbanugo opened this issue Oct 2, 2024 · 2 comments
Open

Comments

@pmbanugo
Copy link

pmbanugo commented Oct 2, 2024

I start the server successfully, but I get an error when I open localhost:3000.

Error says


[Req started] {"name":"1 GET /"}
26 |     );
27 |     Object.values(
28 |       normalizeStringPasswordToMap(userSessionOptions.password)
29 |     ).forEach((password) => {
30 |       if (password.length < 32) {
31 |         throw new Error(
                   ^
error: iron-session: Bad usage. Password must be at least 32 characters long.

is there a specific URL I need to add?

@pims
Copy link

pims commented Oct 13, 2024

Make sure your secrets are that long.
Example:

SECRET=t7Qv4eLsAvIzNuYZQZMzVhtKhualX4yk
WSS_API_SECRET=ibURz0ALysYA6HXBnw3xyynnTaaq037a
AUTH_COOKIE_SECRET=KgxY8VNhw8hfMkfa4RK3Wgg4WYsfiF03

@OzzieOrca
Copy link
Contributor

Specifically I think it's AUTH_COOKIE_SECRET that has the 32 character min length validation. From https://github.com/interval/server?tab=readme-ov-file#required-environment-variables:

AUTH_COOKIE_SECRET is a secret that you must provide for use in encrypting session cookies. Any string at least 32 characters in length is valid for this value, but you should use something secure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants