mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Small refactors
This commit is contained in:
parent
2cadb68a56
commit
3b452d66aa
22 changed files with 165 additions and 76 deletions
|
|
@ -1,20 +0,0 @@
|
|||
import { Token } from "~database/entities/Token";
|
||||
|
||||
export const getUserByToken = async (access_token: string | null) => {
|
||||
if (!access_token) return null;
|
||||
|
||||
const token = await Token.findOne({
|
||||
where: {
|
||||
access_token,
|
||||
},
|
||||
relations: {
|
||||
user: {
|
||||
relationships: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!token) return null;
|
||||
|
||||
return token.user;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue