*/
async isValidIdentifierCredential(identifier, credential, ctx) {
const _scope = _fileScope('isValidIdentifierCredential');
- this.logger.debug(_scope, 'called', { identifier, credential: '*'.repeat(credential.length), ctx });
+ this.logger.debug(_scope, 'called', { identifier, credential: '*'.repeat((credential || '').length), ctx });
let isValid = false;
+ if (typeof credential === 'undefined') {
+ return isValid;
+ }
+
await this.db.context(async (dbCtx) => {
const authData = await this.db.authenticationGet(dbCtx, identifier);
if (!authData) {
const cookieParts = [
sessionCookie,
'HttpOnly',
- `Path=${this.options.dingus.proxyPrefix}/`,
`Max-Age=${this.cookieLifespan}`,
+ 'SameSite=Lax',
+ `Path=${this.options.dingus.proxyPrefix}/`,
];
- if (this.options.authenticator.secureAuthOnly) {
+ if (this.secureAuthOnly) {
cookieParts.push('Secure');
}
res.setHeader(Enum.Header.SetCookie, cookieParts.join('; '));
`${Enum.SessionCookie}=""`,
'HttpOnly',
'Max-Age=0',
+ 'SameSite=Lax',
`Path=${this.options.dingus.proxyPrefix}/`,
];
if (this.options.authenticator.secureAuthOnly) {
}
-module.exports = Authenticator;
\ No newline at end of file
+module.exports = Authenticator;