You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
418 B

import { knex } from '../../database/knex';
import { User } from './user.model';
export interface UserToken {
id: string;
user_id: User['id'];
token_hash: string;
created_at: string;
expires_at: string;
renewed_at: string;
is_revoked: boolean;
export const getUserTokens = async (userId: number): Promise<UserToken[]> => {
return knex<UserToken>('hexbear.user_tokens').where('user_id', userId);