Appearance
User Authentication
FreshSource: shipfa.st/docs/tutorials/user-auth
ShipFast uses NextAuth for authentication, configured in /app/api/auth/[...nextauth]/route.js.
Authentication Methods
| Method | Setup Guide |
|---|---|
| Magic Links | Magic Links Feature |
| Google OAuth | Google OAuth Feature |
Login Button Example
After setting up at least one auth method:
javascript
"use client"
import { signIn } from "next-auth/react";
import config from "@/config";
const SigninButton = () => {
return (
<button
className="btn btn-primary"
onClick={() => signIn(undefined, { callbackUrl: config.auth.callbackUrl })}
>
Login
</button>
);
};
export default SigninButton;INFO
The callbackUrl in config.js redirects users after successful login. Usually set to a private page like /dashboard.