SaasCore Docs
  • Get Started
  • Configuration
    • Database
    • Stripe
      • Product ID and Price ID
      • API keys
      • Stripe Webhook
    • Emails
      • Cron Jobs
    • Claudinary
    • Chat plugin
    • Upstash Redis
    • OAuth with Google and GitHub
    • Subscription types and plans
    • Affiliate program
    • Google Analytics Api
  • Landing page
    • Header
    • Hero
      • Discount
      • AvatarCircles
    • Other components
  • Authentication Flow
    • For Admins
    • For Clients
      • OAuth
      • Credentials
    • For Affiliates
  • Payments
    • Payment Flow Scenarios
      • Scenario 1: Registered Client
      • Scenario 2: Direct Subscription from Home Page
      • Upgrading/Downgrading/Canceling Subscriptions
    • Pricing Table
  • Component Protection
  • Pending ...
Powered by GitBook
On this page
  • Important Functions to know
  • setupUserAccount()
  • handleAfterSignupTasks()

Authentication Flow

Our boilerplate supports two types of authentication systems:

  1. OAuth Providers (e.g., Google, GitHub)

  2. Credentials (traditional method)

Important Functions to know

setupUserAccount()

Location: actions/setup-account.ts Purpose: Sets up the user account by:

  • Assigning the user role.

  • Creating the ClientPlan record.

  • Calling handleAfterSignupTasks().

handleAfterSignupTasks()

Location: actions/setup-account.ts Purpose: Handles additional tasks post-signup:

  • Adds the email to the audience list (on Resend).

  • Sends a welcome email to the client.

  • Sets up the NotificationPreferences table.

  • Assigns a country to the user.

  • Adds contact to the Affiliates database (if it’s an affiliate).

  • Sends a welcome email to the affiliate (if applicable).

PreviousOther componentsNextFor Admins

Last updated 10 months ago