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

Allow dev to set SameSite, MaxAge, & Secure attributes on cookie #97

Open
websocket98765 opened this issue Jun 17, 2022 · 1 comment
Open

Comments

@websocket98765
Copy link

websocket98765 commented Jun 17, 2022

Relevant line in sk-auth:

"set-cookie": `svelteauthjwt=${jwt}; Path=/; HttpOnly`,

Maybe also relevant? Do JWT and cookie need to be set to the same expiration?

expiresIn: this.config?.jwtExpiresIn ?? "30d",

@websocket98765 websocket98765 changed the title Allow dev to set Strict, SameSite, & MaxAge attributes on cookie Allow dev to set SameSite & MaxAge attributes on cookie Jun 18, 2022
@websocket98765
Copy link
Author

websocket98765 commented Jun 18, 2022

Possible solution would be to have add something like this to the config:

cookie: {
   maxAge: 1234,                  // jwtExpires and cookie probably should be set the same automatically
   sameSite: 'Strict',             // 'Lax' is the browser default if unspecified according to Mozilla link above
   secure: dev ? false : true       // defaults to false; dev would use `dev ? true : false` as the value most likely.
}

@websocket98765 websocket98765 changed the title Allow dev to set SameSite & MaxAge attributes on cookie Allow dev to set SameSite, MaxAge, & Secure attributes on cookie Jun 18, 2022
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

1 participant