shivam51
06/22/2022, 4:46 AMrp_st
06/22/2022, 5:04 AMrp_st
06/22/2022, 5:41 AMshivam51
06/22/2022, 5:42 AMrp_st
06/22/2022, 5:42 AMrp_st
06/22/2022, 5:42 AMshivam51
06/22/2022, 5:44 AMshivam51
06/22/2022, 5:46 AMrp_st
06/22/2022, 5:47 AMshivam51
06/22/2022, 5:47 AMrp_st
06/22/2022, 5:49 AMrp_st
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_st will it look something like this then?rp_st
06/22/2022, 7:31 AMshivam51
06/22/2022, 7:36 AMshivam51
06/22/2022, 7:36 AMrp_st
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?shivam51
06/22/2022, 7:37 AMrp_st
06/22/2022, 7:37 AMshivam51
06/22/2022, 7:48 AMshivam51
06/22/2022, 7:48 AMerror: "Email not allowed to sign up / in"
right?shivam51
06/22/2022, 7:48 AMrp_st
06/22/2022, 7:49 AMrp_st
06/22/2022, 7:49 AM