Wepik.com Login Info
const res = await fetch('/api/auth/login', method: 'POST', headers: 'Content-Type': 'application/json' , body: JSON.stringify( email, password ) );
return ( <form onSubmit=handleSubmit> <input type="email" value=email onChange=e => setEmail(e.target.value) required /> <input type="password" value=password onChange=e => setPassword(e.target.value) required /> error && <div className="error">error</div> <button type="submit">Log in</button> </form> ); wepik.com login
Goal Allow users to securely access their Wepik account (saved designs, templates, premium assets, etc.) using email/password or social login. const res = await fetch('/api/auth/login'
const token = jwt.sign( userId: user.id, role: user.role , process.env.JWT_SECRET, expiresIn: '7d' ); headers: 'Content-Type': 'application/json'
res.cookie('token', token, httpOnly: true, secure: process.env.NODE_ENV === 'production', sameSite: 'strict', maxAge: 7 * 24 * 60 * 60 * 1000 );
const handleSubmit = async (e: React.FormEvent) => e.preventDefault(); setError('');