Shiply uses Auth.js to authenticate users. You can configure it in the /src/lib/next-auth.ts
and /auth.config.ts
Let's dive into using Auth.js for Magic Linkπ and Credential login methods! β¨
signIn('...')
to make it happen.1 import { signIn } from 'next-auth/react';
2
3 const handleMagicLinkLogin = () => {
4 signIn('...');
5 };
6
7 <button onClick={handleMagicLinkLogin}>Sign</button>
AuthLayout
or DataLayout
components to control access:AuthLayout
are publicly available.1 export default function Layout({children}: Readonly<{
2 children: React.ReactNode;
3 }>) {
4 return (
5 <AuthLayout>
6 {children}
7 </AuthLayout>
8 );
9 }
DataLayout
require authentication.1 export default function Layout({children}: Readonly<{
2 children: React.ReactNode;
3 }>) {
4 return (
5 <DataLayout>
6 {children}
7 </DataLayout>
8 );
9 }