Skip to content

Commit

Permalink
Merge pull request #24 from baptisteArno/feat/disable-smtp-auth
Browse files Browse the repository at this point in the history
Feat/disable-smtp-auth
  • Loading branch information
baptisteArno authored Apr 11, 2022
2 parents 6a8d6d4 + c657850 commit 1820686
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
51 changes: 26 additions & 25 deletions apps/builder/components/auth/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,33 @@ export const SignInForm = ({
setAuthLoading(false)
}
return (
<Stack spacing="4">
<Stack spacing="4" w="330px">
<SocialLoginButtons />
{process.env.NEXT_PUBLIC_SMTP_FROM && (
<>
<DividerWithText mt="6">Or with your email</DividerWithText>
<HStack as="form" onSubmit={handleEmailSubmit}>
<Input
name="email"
type="email"
autoComplete="email"
placeholder="email@company.com"
required
value={emailValue}
onChange={handleEmailChange}
/>
<Button
type="submit"
isLoading={
['loading', 'authenticated'].includes(status) || authLoading
}
>
Submit
</Button>
</HStack>
</>
)}
{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}>
<Input
name="email"
type="email"
autoComplete="email"
placeholder="email@company.com"
required
value={emailValue}
onChange={handleEmailChange}
/>
<Button
type="submit"
isLoading={
['loading', 'authenticated'].includes(status) || authLoading
}
>
Submit
</Button>
</HStack>
</>
)}
</Stack>
)
}
5 changes: 4 additions & 1 deletion apps/builder/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
EmailProvider({
server: {
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/docs/self-hosting/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ Used for Google Fonts:

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)

Used for authenticating with GitHub. By default, it uses the credentials of a Typebot-dev app.
Expand Down

4 comments on commit 1820686

@vercel
Copy link

@vercel vercel bot commented on 1820686 Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1820686 Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1820686 Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1820686 Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app

Please sign in to comment.