'use strict';
import { getResource } from '../db/db.js';
import { resourceNames } from '../../../../fd-toolbox/resources/resource-names.js';
import { parseUtcStringToDate, getNowUtc } from '../../../../fd-toolbox/dates/date-time.js';
import { headerNames } from '../../../../fd-toolbox/constants/header-names.js';

var __defProp=Object['defineProperty'],__name=(_0x4824b3,_0x205d2e)=>__defProp(_0x4824b3,'name',{'value':_0x205d2e,'configurable':!![]});const sessionCookieName='auth_session';async function validateSession(_0x138ed3){const _0x59e82a=await getResource({'resourceName':resourceNames['session'],'id':_0x138ed3},![]);if(_0x59e82a&&parseUtcStringToDate(_0x59e82a['expiresAt'])['getTime']()>getNowUtc()['getTime']())return _0x59e82a;return void(0x7*0x121+0x12a1+-0x1a88);}__name(validateSession,'validateSession');function readBearerToken(_0x249a29){return _0x249a29['replace'](headerNames['authHeaderValuePrefix'],'');}__name(readBearerToken,'readBearerToken');

export { readBearerToken, sessionCookieName, validateSession };
