Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Possibility to set secure flag for cookie depending on environment #46

Closed
re-mxp opened this issue Nov 27, 2022 · 6 comments · Fixed by #49
Closed

Possibility to set secure flag for cookie depending on environment #46

re-mxp opened this issue Nov 27, 2022 · 6 comments · Fixed by #49
Labels
enhancement New feature or request

Comments

@re-mxp
Copy link
Contributor

re-mxp commented Nov 27, 2022

Describe the feature

At the moment it is only possible to use the Local-address to set the session cookie, because it's not allowed to set a non https cookie with the secure flag.
grafik

I would like the possiblity to also use the Network-address:
grafik

But it results in following error in the console:
grafik

Is it possible to make this line also configurable:
https://github.com/sidebase/nuxt-session/blob/main/src/runtime/server/middleware/session/index.ts#L15

Additional information

No response

@re-mxp re-mxp added the enhancement New feature or request label Nov 27, 2022
@BracketJohn
Copy link
Contributor

Sure thing - would you line to controbute a PR to add this? (:

@re-mxp
Copy link
Contributor Author

re-mxp commented Nov 28, 2022

With pleasure :)

@BracketJohn
Copy link
Contributor

Amazing, the feature will be very welcome and should be quite smallish to implement:

  • expand module config with cookieSecure: boolean flag, default value true
  • call useRuntimeConfig to consume cookieSecure in the line you linked above
  • expand the README configuration section to document this feature

@re-mxp
Copy link
Contributor Author

re-mxp commented Nov 28, 2022

Is it possible that you give me the right to push a new branch?

@BracketJohn
Copy link
Contributor

Nope - there's another way to do it in open source work:

  1. Fork the repository (click here https://github.com/sidebase/nuxt-session/fork)
  2. Clone the fork, checkout a new branch, add your changes, commit and push them
  3. Once you're happy, come back to this repo, click open PR and you'll be able to select the branch from your work

As far as I know this mostly comes down to permissions, here's an article explaining this: https://opensource.com/article/19/11/first-open-source-contribution-fork-clone

Does that help / can you continue with that information? (:

@re-mxp
Copy link
Contributor Author

re-mxp commented Nov 29, 2022

Yes thanks for the information :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants