SuperTokens

SuperTokens

  • Docs
  • Discord
  • Blog

โ€บMake your own frontend

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 custom theme

Disable default implementation ๐Ÿ”

SuperTokens.init({
    appInfo: {...},
    recipeList: [
        EmailPassword.init({
            resetPasswordUsingTokenFeature: {
                disableDefaultImplementation: true,
                (...)
            },
            (...)
        }),
        (...)
    ]
});

If you navigate to /auth/reset-password, you should not see the default widget anymore.

Add component ๐Ÿ“ƒ

Start by importing the ResetPasswordUsingToken feature component from supertokens-auth-react/recipe/emailpassword and render it anywhere in your application:


import {ResetPasswordUsingToken} from 'supertokens-auth-react/recipe/emailpassword';

class Authentication extends React.Component {
    render() {
        return (
            <ResetPasswordUsingToken/>
        )
    }
}

Create a Reset password custom theme

Create a ResetPasswordUsingTokenTheme React component:

import React from "react";

/*
 * ResetPasswordUsingTokenTheme
 * props given from ResetPasswordUsingToken feature component: https://github.com/supertokens/supertokens-auth-react/blob/6210816e5d4f0058d2699d1c8aa15acf3cd8d1ff/lib/ts/recipe/emailpassword/types.ts#L511
 */

export default function ResetPasswordUsingTokenTheme(props){
 /*
  *  Your custom implementation goes here.
  * 
  */
}

In your Authentication component:


import {ResetPasswordUsingToken} from 'supertokens-auth-react/recipe/emailpassword';
import ResetPasswordUsingTokenTheme from './ResetPasswordUsingTokenTheme';

class Authentication extends React.Component {
    render() {
        return (
            <ResetPasswordUsingToken>
                <ResetPasswordUsingTokenTheme>
            </ResetPasswordUsingToken>
        )
    }
}

Styling

Please refer to the corresponding section for styling Sign-up / Sign-in

API

Please refer to the corresponding section for API Sign-up / Sign-in

Implementing a generic Reset Password

Please refer to the corresponding section for generic implementation of a Sign-up / Sign-in theme

โ† Sign-up / Sign-in custom themeSign up custom API โ†’