/**
 *
 * @description this file contain the @validateAuthToken function that be used inside the middleware.ts
 * * source : https://mongoosejs.com/docs/6.x/docs/typescript.html
 */

export default async function validateAuthToken(authToken : string | undefined) : Promise<boolean | undefined>
{
    let data : {
        success : boolean,
    } = await (await fetch(process.env.NEXT_PUBLIC_API_BASE+"/api/auth?authToken="+authToken)).json()
    return data.success
}