Authentication
Sign up
Create the sign up endpoint
import createSlykClient from '@slyk/slyk-sdk-node';
export default async function handler(request, response) {
if (request.method !== 'POST') {
response.status(404);
return;
}
const slyk = createSlykClient({ apikey: process.env.SLYK_API_KEY });
const { name, email, password } = request.body;
const user = await slyk.user.create({
name,
email,
password,
verified: true,
});
response.status(200).json(user);
}Create the sign up page
Sign in
Create the sign in endpoint
Create the sign in page
Get the user's data
Create the user data endpoint
Refreshing the tokens
Sign out
Create the sign out endpoint
Add a sign out button somewhere in your app
Last updated