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

set auth token from server side cookie value name #268

Open
cpreston321 opened this issue Dec 5, 2022 · 2 comments
Open

set auth token from server side cookie value name #268

cpreston321 opened this issue Dec 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@cpreston321
Copy link
Contributor

Your use case

When I login the auth token gets set as a cookie and only available to the server. It would be nice to see if I could define a cookie name that nuxt-graphql-client looks for and set's the cookie value as auth for me.

The solution you'd like

I would like to define a cookie name SERVER_COOKIE_NAME_AUTH and then it will auth using that cookie passing it down to the client app to auth.

Possible alternatives

No response

Additional information

No response

@cpreston321 cpreston321 added the enhancement New feature or request label Dec 5, 2022
@Diizzayy
Copy link
Owner

Diizzayy commented Dec 7, 2022

When I login the auth token gets set as a cookie and only available to the server

if you've set httpOnly: true option in cookieOptions, that would result in the cookie only being accessible via the server.

@cpreston321 You can leverage tokenStorage.name to specify the name you'd like to be used for the cookie.

@cpreston321
Copy link
Contributor Author

@Diizzayy Since the cookie has already been set by a thrid-party system I have to leverage this cookie to auth with GQL but when we deploy projects all cookies are only accessible through .<subdomain> to access it.

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

No branches or pull requests

2 participants