Skip to Content
This project is in active development. Features and behaviors may change without notice.
DocumentationUsageGenerate Login Page

Generate Login Page

The SAuthBase SDK provides the generationAuthPageUrl() method, which allows you to easily generate a redirect URL to the Scratch authentication page.

Redirecting users to this URL enables authentication using their Scratch account.


Basic Usage

src/index.ts
import { } from "sauthbase"; const = .(); const = .("My App");

This method returns a URL like the following:

https://auth.itinerary.eu.org/auth/?redirect=..&name=..

The redirect_url specified during init() will be used here.


Example: Using in a Router

src/index.ts
.("/login", () => { const = .("My App"); if (.) { return .(.); } else { return .(); } });

By accessing /login, users will be automatically redirected to the authentication page.


Notes

generationAuthPageUrl() encodes the redirect URL using Base64. To avoid tampering, it should be generated on the server side.

  • The title argument will be displayed as the heading on the authentication page. If omitted, "ScratchCore" is used by default.
  • If redirect_url has not been initialized, the URL will not be generated correctly.

After authentication is completed, the user will be redirected with a privateCode parameter.

Last updated on