2
0

feat(auth): 👷 Disable smtp auth

This commit is contained in:
Baptiste Arnaud
2022-04-11 10:15:07 -05:00
parent 6a8d6d4d9a
commit c6578505a5
3 changed files with 36 additions and 26 deletions

View File

@@ -50,32 +50,33 @@ export const SignInForm = ({
setAuthLoading(false) setAuthLoading(false)
} }
return ( return (
<Stack spacing="4"> <Stack spacing="4" w="330px">
<SocialLoginButtons /> <SocialLoginButtons />
{process.env.NEXT_PUBLIC_SMTP_FROM && ( {process.env.NEXT_PUBLIC_SMTP_FROM &&
<> process.env.NEXT_PUBLIC_SMTP_AUTH_DISABLED !== 'true' && (
<DividerWithText mt="6">Or with your email</DividerWithText> <>
<HStack as="form" onSubmit={handleEmailSubmit}> <DividerWithText mt="6">Or with your email</DividerWithText>
<Input <HStack as="form" onSubmit={handleEmailSubmit}>
name="email" <Input
type="email" name="email"
autoComplete="email" type="email"
placeholder="email@company.com" autoComplete="email"
required placeholder="email@company.com"
value={emailValue} required
onChange={handleEmailChange} value={emailValue}
/> onChange={handleEmailChange}
<Button />
type="submit" <Button
isLoading={ type="submit"
['loading', 'authenticated'].includes(status) || authLoading isLoading={
} ['loading', 'authenticated'].includes(status) || authLoading
> }
Submit >
</Button> Submit
</HStack> </Button>
</> </HStack>
)} </>
)}
</Stack> </Stack>
) )
} }

View File

@@ -22,7 +22,10 @@ providers.push(
}) })
) )
if (process.env.NEXT_PUBLIC_SMTP_FROM) if (
process.env.NEXT_PUBLIC_SMTP_FROM &&
process.env.NEXT_PUBLIC_SMTP_AUTH_DISABLED !== 'true'
)
providers.push( providers.push(
EmailProvider({ EmailProvider({
server: { server: {

View File

@@ -58,6 +58,12 @@ Used for Google Fonts:
The following variables are only used for the builder. The following variables are only used for the builder.
### Email
| Parameter | Default | Description |
| ------------------------------ | ------- | -------------------------------------- |
| NEXT_PUBLIC_SMTP_AUTH_DISABLED | false | To disable the authentication by email |
### GitHub (optional) ### GitHub (optional)
Used for authenticating with GitHub. By default, it uses the credentials of a Typebot-dev app. Used for authenticating with GitHub. By default, it uses the credentials of a Typebot-dev app.