nuxt-graphql-client icon indicating copy to clipboard operation
nuxt-graphql-client copied to clipboard

set auth token from server side cookie value name

Open cpreston321 opened this issue 3 years ago • 2 comments

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 avatar Dec 05 '22 13:12 cpreston321

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.

Diizzayy avatar Dec 07 '22 05:12 Diizzayy

@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.

cpreston321 avatar Dec 07 '22 14:12 cpreston321