shivam51
06/22/2022, 4:46 AMrp
06/22/2022, 5:04 AMshivam51
06/22/2022, 5:42 AMrp
06/22/2022, 5:42 AMshivam51
06/22/2022, 5:44 AMrp
06/22/2022, 5:47 AMshivam51
06/22/2022, 5:47 AMrp
06/22/2022, 5:49 AMThirdPartyEmailPassword.init({
override: {
functions: (oI) => {
return {
...oI,
thirdPartySignInUp: async function (input) {
let email = input.email;
if (!isEmailAllowed(email)) { // your custom email check
return {
status: "FIELD_ERROR",
message: "Email not allowed to sign up / in"
}
}
return oI.thirdPartySignInUp(input);
}
}
}
}
})
shivam51
06/22/2022, 7:30 AMjs
export class SupertokensService {
constructor(@Inject(ConfigInjectionToken) private config: AuthModuleConfig) {
supertokens.init({
appInfo: config.appInfo,
supertokens: {
connectionURI:
'fooBar',
apiKey: 'fooBar',
},
recipeList: [
ThirdPartyEmailPassword.init({
override: {
functions: (oI) => {
return {
...oI,
thirdPartySignInUp: async function (input) {
let email = input.email;
if (!isEmailAllowed(email)) { // your custom email check
return {
status: "FIELD_ERROR",
message: "Email not allowed to sign up / in"
}
}
return oI.thirdPartySignInUp(input);
}
}
}
},
providers: [
ThirdPartyEmailPassword.Google({
clientId:
'fooBar',
clientSecret: 'fooBar',
})
],
}),
Session.init(),
],
});
}
}
Hey @rp will it look something like this then?rp
06/22/2022, 7:31 AMshivam51
06/22/2022, 7:36 AMrp
06/22/2022, 7:37 AMemail.id
shivam51
06/22/2022, 7:37 AMemail
stores the userId and if he is verified or not, for isEmailAllowed
I would be needing the email itself right?rp
06/22/2022, 7:37 AMshivam51
06/22/2022, 7:48 AMerror: "Email not allowed to sign up / in"
right?rp
06/22/2022, 7:49 AM