ojasaklechayt / Music-Streaming-App

Music Streaming App MERN App
https://groovewave.vercel.app
Creative Commons Zero v1.0 Universal
13 stars 18 forks source link

Feat middleware #7

Closed fiskryeziu closed 1 year ago

fiskryeziu commented 1 year ago

6 Added middleware for persistent user login, for public routes user will be redirected to home if logged in & redirected to /login if not logged

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
groovewave ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 0:39am
ojasaklechayt commented 1 year ago

@fiskryeziu can we also make profile page restricted only when user is logged in ?

fiskryeziu commented 1 year ago

Middleware applies also for profile route if it's not logged in will redirect to /login . That's why we use the

export const config = {
    matcher: ['/', '/login', '/profile', '/register'],
}
ojasaklechayt commented 1 year ago

Middleware applies also for profile route if it's not logged in will redirect to /login

Okay!! Great! Will merge it