ZapStack

Authentication

Define the ways to login to your app

We use Auth.js for the authentication.

Enable/disable login methods

All methods are enabled by default, change config at /configs/auth.ts:

export const AuthMethods = {
  MagicLink: true,
  Google: true,
  Github: true,
};

Setup auth methods

Secure

  1. Remember to add a random string for AUTH_SECRET in .env that uses to generate auth token.

  2. JWT max age.

Since the default setup is using JWT strategy (our recommendation) instead of Session strategy, so consider to config the suitable time to expire the tokens after a period of time in /configs/auth.ts:

export const JwtMaxAge = 30 * 24 * 60 * 60; // 30 days

On this page