russmedia-digital / cordova-plugin-google-signin

Cordova Google SignIn
Apache License 2.0
11 stars 29 forks source link

Incorrect JSON format in successful response #3

Closed ludovictomlo closed 2 years ago

ludovictomlo commented 2 years ago

The success callback from the OneTap Signin is giving the stringified JSON response in the following format:

"{"status":"success", "message":"{"id":"", "display_name":"", "email":"", "photo_url":"", "id_token":""}"}"

As you see the message object seems to have a stringified value instead of a JSON which makes the JSON.parse() function fail with error Unexpected character "i" at position 38 when parsing the whole object.

The correct format would be without the extra double quotes around the message object follows:

"{"status":"success", "message":{"id":"", "display_name":"", "email":"", "photo_url":"", "id_token":""}}"