JSON web token (JWT) is an open standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object.
Quick start
Follow these steps if you want to enable JWT authentication in your application.
1. Enable AuthProvider
Enable JWT's AuthProvider in /src/app/layout.js.
import { AuthProvider } from "@/contexts/JWTContext";
function RootLayout() {
return (
<AuthProvider>
{content}
</AuthProvider>;
)
}
2. Enable useAuth hook
Enable JWT's useAuth hook in /src/hooks/useAuth.js.