cboard-org / cboard-ai-builder

The Cboard AI Builder is an augmentative and alternative communication (AAC) board generator designed to streamline the creation process for speech therapists or caregivers. It aims to reduce the time required to create specific AAC boards and provide a preliminary draft quickly.
https://cboard.io
GNU General Public License v3.0
6 stars 1 forks source link

Redirect user to login page if there is no session #110

Closed RodriSanchez1 closed 4 months ago

RodriSanchez1 commented 4 months ago

Validate on server actions if the user is logged in. This can be done using:

const session = await getServerSession(authConfig);
if (!session) {
  return { error: { message: 'Failed to get session, please log in' } }; //redirect to login
}

If is not logged in, redirect it to login page