linty fresh(er)
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-05-02 20:23:19 -04:00
parent d47c229178
commit adb3866700
3 changed files with 4 additions and 4 deletions

View File

@@ -5,8 +5,8 @@ import { sign } from './jwt';
export const getAuthenticationBundle = async (username: string, password: string) => {
const auth = await Auth.findByUsername(username).catch();
const isAuthenticated = !!auth && (auth as AuthModel).authenticate(password);
const record = isAuthenticated ? (auth as AuthPrivate).record : null;
const token = isAuthenticated ? (auth as AuthModel).getToken() : sign();
const record = isAuthenticated ? (auth as AuthPrivate).record as string : null;
const token = sign(record || undefined);
return {
record,
token,

View File

@@ -1,4 +1,4 @@
import jsonwebtoken, { JwtPayload } from 'jsonwebtoken';
import jwt from 'jsonwebtoken';
export interface TokenProps {
aud?: string;