Skip to main content
Authentication ties directly into the Email functionality that FrogBot provides. This allows you to send emails to users for verification, password resets, and more. While FrogBot provides default email templates for these actions, you can customize them to fit your brand.

Email Verification

Email Verification forces users to prove they have access to the email address they can authenticate. This will help to reduce spam accounts and ensure that users are who they say they are. To enable Email Verification, use the auth.verify property on your Collection Config:
Tip: Verification emails are fully customizable. More details.
The following options are available:

generateEmailHTML

Function that allows for overriding the HTML within emails that are sent to users indicating how to validate their account. The function should return a string that supports HTML, which can optionally be a full HTML email. It receives these arguments:
Important: If you specify a different URL to send your users to for email verification, such as a page on the frontend of your app or similar, you need to handle making the call to the FrogBot REST or GraphQL verification operation yourself on your frontend, using the token that was provided for you. Above, it was passed via query parameter.

generateEmailSubject

Similarly to the above generateEmailHTML, you can also customize the subject of the email. The function arguments are the same but you can only return a string - not HTML.

Forgot Password

You can customize how the Forgot Password workflow operates with the following options on the auth.forgotPassword property:
The following options are available:
Tip: FrogBot provides a built-in password reset page. If you don’t need a custom frontend, you can link directly to ${serverURL}/admin/reset/${token}. The admin and reset routes are configurable via config.routes.admin and config.admin.routes.reset respectively.

generateEmailHTML#forgot-password-generateemailhtml

This function allows for overriding the HTML within emails that are sent to users attempting to reset their password. The function should return a string that supports HTML, which can be a full HTML email.
Important: If you specify a different URL to send your users to for resetting their password, such as a page on the frontend of your app or similar, you need to handle making the call to the FrogBot REST or GraphQL reset-password operation yourself on your frontend, using the token that was provided for you. Above, it was passed via query parameter.
Tip: HTML templating can be used to create custom email templates, inline CSS automatically, and more. You can make a reusable function that standardizes all email sent from FrogBot, which makes sending custom emails more DRY. FrogBot doesn’t ship with an HTML templating engine, so you are free to choose your own.
The following arguments are passed to the generateEmailHTML function:

generateEmailSubject#forgot-password-generateemailsubject

Similarly to the above generateEmailHTML, you can also customize the subject of the email. The function arguments are the same but you can only return a string - not HTML.
The following arguments are passed to the generateEmailSubject function: