ankitjey
04/24/2021, 12:39 PMreturn send200Response(res, {
status: 'FIELD_ERROR',
formFields: {
id: 'email',
error:
'This email is already in use via a social provider. Please sign in instead.',
},
});
this doesn't seem to work, not showing any error on the uirp
04/24/2021, 1:09 PMGENERAL_ERROR
(example here: https://github.com/supertokens/supertokens-node/blob/master/lib/ts/recipe/emailpassword/api/signin.ts#L63), which if thrown passes the err
object to your error handler.rp
04/24/2021, 1:13 PMformFields
must be an array:
return send200Response(res, {
status: 'FIELD_ERROR',
formFields: [{
id: 'email',
error:
'This email is already in use via a social provider. Please sign in instead.',
}],
});
ankitjey
04/24/2021, 1:23 PMankitjey
04/24/2021, 1:24 PMrp
04/24/2021, 1:25 PMankitjey
04/24/2021, 1:29 PMthrow new STError(
{
type: STError.BAD_INPUT_ERROR,
message: 'Please provide the code in request body',
},
recipeInstance,
);
Shouldn't they be received by the UI or something?rp
04/24/2021, 1:30 PMankitjey
04/24/2021, 2:01 PMrp
04/24/2021, 2:02 PMankitjey
04/24/2021, 2:02 PMrp
04/24/2021, 2:02 PMrp
04/24/2021, 5:00 PMthrow new STError(
{
type: "FIELD_ERROR",
message: "Some custom message"
},
recipeInstance
);
This will show "Some custom message" on the signup screen when the user tries to login using a social provider.ankitjey
04/24/2021, 7:39 PMxonar7
04/25/2021, 7:48 AMrp
04/25/2021, 8:03 AMrp
04/25/2021, 8:04 AMidRefreshToken
is the same as that of the refresh token, and whenever the refresh token changes, so does the value of idRefreshToken
. However, the value of idRefreshToken
itself is meaningless.xonar7
04/25/2021, 9:58 AMrp
04/25/2021, 9:59 AMrp
04/25/2021, 9:59 AMidRefreshToken
is exactly what I described in my previous comment.user
04/25/2021, 10:17 AMappInfo: {
appName: "WorkoutApp",
apiDomain: "https://blah-blah.execute-api.blah-blah.amazonaws.com",
apiBasePath: "/dev/auth",
websiteDomain: "https://blah-blah.execute-api.blah-blah.amazonaws.com/dev/auth",
},
but then on SignUp I get a CORS-related error:
Access to fetch at 'https://blah-blah.execute-api.blah-blah.amazonaws.com/dev/auth/signup/email/exists?email=qwwqwq%40hahah.com' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I think earlier you mentioned that apiDomain
and websiteDomain
have to be the same 🤔rp
04/25/2021, 10:33 AMwebsiteDomain
should be "https://blah-blah.execute-api.blah-blah.amazonaws.com"
and there is websiteBasePath
which should be changed to "/dev/auth"
.
For development, youe websiteDomain
will be "http://localhost:3000"
.
Finally, CORS error can be fixed by doing this step: https://supertokens.io/docs/thirdpartyemailpassword/quick-setup/backend#3-add-the-supertokens-and-cors-middleware, where the origin
value should be "http://localhost:3000"
.rp
04/25/2021, 10:34 AMhttps://blah-blah.execute-api.blah-blah.amazonaws.com
, and the website domain (during dev) is http://localhost:3000
. So you need to deal with CORS.user
04/25/2021, 3:05 PMrp
04/25/2021, 3:06 PMhttp://localhost:3000/dev/auth
for the formrp
04/25/2021, 3:06 PMwebsiteBasePath
to /dev/auth
rp
04/25/2021, 3:07 PM/auth
, then you can remove the use of websiteBasePath
from the frontend and backend config.user
04/25/2021, 3:09 PM<Route exact path="/authed">
?user
04/25/2021, 3:10 PMuser
04/25/2021, 3:10 PM