Skip to content

urql/@vue How use authentication in Vue SSR #1463

Answered by kitten
snaplesec asked this question in Q&A
Discussion options

You must be logged in to vote

There's some details on this here, if you have a larger auth need: https://formidable.com/open-source/urql/docs/advanced/authentication/

where is the authExchange in the list? Does it go before or after ssr?

It goes after SSR since it's an asynchronous exchange, i.e. it may do auth calls, while the ssrExchange and cacheExchange are synchronous, i.e. caching, exchanges, so you'll have something like 1. dedup, 2. ssr, 3. cache, 4. auth, 5. fetch

If you need to cater for SSR then you need to find a different way to get your API credentials for getAuth. This will very much depend on your authentication method and how you've set up your app.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@snaplesec
Comment options

@snaplesec
Comment options

Answer selected by JoviDeCroock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants