EdwinN1337
05/27/2022, 1:01 PMshop-web:dev: error - Error: Request failed with status code 400
rp
05/27/2022, 1:04 PMEdwinN1337
05/27/2022, 1:07 PMjs
appInfo,
recipeList: [
ThirdPartyEmailPassword.init({
providers: [
Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
emailPassword
implementation works already 🙂nkshah2
05/27/2022, 1:10 PM/authorisationurl
endpointEdwinN1337
05/27/2022, 1:13 PMjs
{
"status": "OK",
"url": "https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&include_granted_scopes=true&response_type=code&client_id=710520535551-0esc730d0evhv0k77d13v3v3sutla97s.apps.googleusercontent.com"
}
js
{"status":"OK","url":"https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&include_granted_scopes=true&response_type=code&client_id=710520535551-0esc730d0evhv0k77d13v3v3sutla97s.apps.googleusercontent.com"}
nkshah2
05/27/2022, 1:21 PMEdwinN1337
05/27/2022, 1:24 PMnkshah2
05/27/2022, 1:31 PMEdwinN1337
05/27/2022, 1:34 PMnkshah2
05/27/2022, 1:35 PMdata
should have more information about the error (Third party providers usually explain the error or have a specific code here)EdwinN1337
05/27/2022, 2:38 PMjs
const response = await getThirdPartyAuthUrl({ thirdPartyId: 'google' })
if (response.status === 'OK') {
const url = new URL(response.url)
url.searchParams.append('redirect_uri', 'http://localhost:3004/auth/callback/google')
// await openAppBrowser(url.href)
}
nkshah2
05/27/2022, 2:39 PMurl
after appending the redirect urijs
await superTokensNextWrapper(
async (next) => {
await middleware()(req, res, next)
},
req,
res,
)
All I see in the logs is the 400 responsenkshah2
05/27/2022, 2:56 PMdata
propertyrp
05/27/2022, 2:58 PMawait superTokensNextWrapper(...)
and you will see the err in the catch blockEdwinN1337
05/27/2022, 3:04 PM[[...path]]
from docs hehe, let me wrap a try/catchnkshah2
05/27/2022, 3:11 PMEdwinN1337
05/27/2022, 3:13 PMshop-web:dev: data: { error: 'invalid_grant', error_description: 'Bad Request' }
this error is probably expired key?rp
05/27/2022, 3:13 PMEdwinN1337
05/27/2022, 3:14 PMrp
05/27/2022, 3:14 PMEdwinN1337
05/27/2022, 3:15 PMrp
05/27/2022, 3:16 PMEdwinN1337
05/27/2022, 3:16 PM/auth/callback/google
page, i havent fixed any router.push yetrp
05/27/2022, 3:16 PMEdwinN1337
05/27/2022, 3:17 PMrp
05/27/2022, 3:17 PMEdwinN1337
05/27/2022, 3:18 PMrp
05/27/2022, 3:19 PMnkshah2
05/27/2022, 3:19 PMEdwinN1337
05/27/2022, 3:29 PMnkshah2
05/27/2022, 3:31 PMrp
05/27/2022, 3:38 PM