diff --git a/lib/utils/auth.ts b/lib/utils/auth.ts index d5893a4..b8b8ae4 100644 --- a/lib/utils/auth.ts +++ b/lib/utils/auth.ts @@ -1,12 +1,12 @@ import Auth from '../model/auth'; -import { AuthDocument, AuthModel, AuthPrivate } from '../schema/auth'; +import { AuthModel, AuthPrivate } from '../schema/auth'; 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 token = isAuthenticated ? (auth as AuthModel).getToken() : sign(); const record = isAuthenticated ? (auth as AuthPrivate).record : null; + const token = isAuthenticated ? (auth as AuthModel).getToken() : sign(); return { record, token,