SuperTokens

SuperTokens

  • Docs
  • Discord
  • Blog

โ€บReset Password

SIDEBAR_REPLACE_DOC_Introduction

  • Introduction

Quick setup

  • Video tutorial & Architecture
  • Frontend
  • Backend
  • Core

    • Core Overview
    • Self Hosted setup with Docker
    • Self Hosted setup without Docker
    • Managed Service

    Database Setup

    • MySQL
    • PostgreSQL

Common customizations

  • Sign Out
  • Sign Up Form

    • About
    • Adding Extra Fields
    • Adding / Modifying field validators
    • Embed in a page
    • Handling signup success
    • Terms of service & Privacy policy links

    Sign In Form

    • About
    • Adding / Modifying field validators
    • Password managers
    • Embed in a page
    • Show Sign In by default

    Reset Password

    • About
    • Reset password email
    • Embed in a page

    Email Verification

    • About
    • Customising the email sent
    • Embed in a page

    Sessions

    • About
    • Cookie Consent
    • Creating a new session
    • Session Verification in API
    • Change session timeout
    • Checking if a session exists on the frontend
    • Get user information on the frontend
    • Using with FaunaDB

    Styling

    • Changing Colours
    • Changing Style via CSS
    • Themes

    Changing base path

    • Website Base Path
    • API Base Path

    Multi Tenancy

    • About
    • One login, many sub domains
    • One login per sub domain
  • User Pagination

Advanced users

    Advanced session management

    • Share sessions across sub domains
    • Anti CSRF
    • JWT Signing key rotation
    • Access token blacklisting
    • Customizing Error Handling

    Supertokens Core config

    • Adding API Keys
    • Tuning Performance
    • Logging
    • Rename database tables

    Make your own frontend

    • Sign-up / Sign-in custom theme
    • Reset password custom theme

    Make your own backend

    • Sign up custom API
    • Sign in custom API
    • Reset password custom APIs

NextJS

  • SuperTokens with NextJS
  • Deploy with Vercel
  • Deploy with Netlify

SIDEBAR_REPLACE_DOC_SDKs

  • SDKs

SIDEBAR_REPLACE_DOC_Compatibility Table

  • Compatibility Table

Migration

  • Migrating from an older version of SuperTokens
  • Migrating to SuperTokens
  • Migrating away from SuperTokens
  • From managed service to self hosted

Reset password email ๐Ÿ“จ

The default email

  • From: [email protected], but the user will see your app name
  • Subject: Reset password instructions

Send a custom email ๐Ÿ•ถ๏ธ

You can take full control of sending a password reset email by providing the createAndSendCustomEmail function during initialisation (on the backend):

// backend code
supertokens.init({
    supertokens: {...},
    appInfo: {...},
    recipeList: [
        EmailPassword.init({
            resetPasswordUsingTokenFeature: {
                createAndSendCustomEmail: async (user, passwordResetURLWithToken) => {
                    let {id, email} = user;
                    // TODO:
                }
            }
        }),
        Session.init()
    ]
});
  • You can get the user's email via the user input param.
  • Your email must direct the user to open the passwordResetURLWithToken link. This link is a full URL, with the password reset token. It points to the password reset page on your website (/auth/reset-password by default).
  • Any errors thrown from this function will be ignored.
  • The function will be called each time the user clicks on the button to send a password reset email.
  • You must manage sending the email yourself if you provide this function
โ† AboutEmbed in a page โ†’