Unexpected token a in JSON at position
JSON.parse(JSON.stringify(userData))
Unexpected token a in JSON at position
JSON.parse(JSON.stringify(userData))
Unexpected token W in JSON at position 0
Unexpected token W in JSON at position 0
It's because a simple string (plain text) is returned as the response. The text is not a valid JSON. So when you try to do res.json(), it calls JSON.parse(data). Try and do it with the string you provided, and you will get the same error.
use res.text() instead of res.json()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us