Skip to content

fetchToken response error: TypeError: immutable #2017

Answered by phil-w
phil-w asked this question in Q&A
Discussion options

You must be logged in to vote

Got it. I'm mixing promises with waits, numpty error.

The fetchTokens callback should be:

fetchTokens: async (p) => {
	const r = await fetch(`${baseUrl}/api/user/dexie`, {
		method: 'POST', credentials: 'same-origin',
		headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(p)
  	})
	return await r.json()
}
~~

Job done in **Sveltekit**.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by phil-w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant