Skip to content
Blog

Hosted Auth Pages

Tribe’s hosted pages give you a fully functional authentication flow without building any forms. Login, registration, email verification, password reset, magic links, all of it works out of the box. Your app simply redirects users to these pages and receives them back once they’ve authenticated.

  1. Your app calls redirectToLogin(), which sends the user over to Tribe’s hosted login page
  2. The user authenticates through whichever method they prefer (email and password, social login, or magic link)
  3. On success, Tribe redirects them back to your app with a session token embedded in the URL
  4. The SDK picks up the token automatically, stores it in localStorage, and cleans the URL so nothing looks out of place

You don’t need to write any token-handling code. After the redirect, calling getSession() returns the authenticated user just as you’d expect.

<script src="https://api.tribe.utopian.build/sdk.js?site=YOUR_SITE_ID" defer></script>
<script defer>
window.addEventListener("DOMContentLoaded", async () => {
const session = await Tribe.getSession();
if (!session) {
Tribe.redirectToLogin();
return;
}
// User is authenticated
showApp(session.user);
});
</script>

By default, Tribe sends users back to whichever page they came from. You can override the redirect target if you’d rather land them somewhere specific:

tribe.redirectToLogin({ redirectUrl: "https://myapp.com/dashboard" });
tribe.redirectToRegister({ redirectUrl: "https://myapp.com/onboarding" });
PageURLPurpose
Login/auth/loginSign in with email and password, magic link, or social providers
Register/auth/registerCreate a new account
Verify Email/auth/verify?token=xxxConfirm an email address (linked from the verification email Tribe sends)
Forgot Password/auth/forgot-passwordRequest a password reset email
Reset Password/auth/reset-password?token=xxxChoose a new password after receiving the reset email
Magic Link/auth/magic-link?token=xxxVerify the magic link token and redirect the user into your app

If you’ve enabled any social login providers (Google, GitHub, Discord, Twitter) in your site’s Auth settings, the hosted pages automatically display the corresponding buttons. No additional wiring on your end.

When your site belongs to a Tribe organization, redirectToLogin() checks whether the user already has a session from another site in the same org. If they do, they’re signed in seamlessly without seeing a login form. That’s how single sign-on works across Tribe organizations.

Hosted PagesCustom UI
Setup timeMinutesHours
Custom designNoYes
Social loginAutomaticYou build the buttons
Email verificationHandledYou build the pages
Password resetHandledYou build the pages

If you need full control over how authentication looks and feels, head over to the Custom Login UI guide.