Add new user patch route

This commit is contained in:
Jesse Wierzbinski 2023-09-13 09:02:16 -10:00
parent b96fe8116e
commit 0bdf559bdc
No known key found for this signature in database
GPG key ID: F9A1E418934E40B0
4 changed files with 180 additions and 0 deletions

13
utils/auth.ts Normal file
View file

@ -0,0 +1,13 @@
import { Token } from "~database/entities/Token";
export const getUserByToken = async (access_token: string | null) => {
if (!access_token) return null;
const token = await Token.findOneBy({
access_token,
});
if (!token) return null;
return token.user;
};

View file

@ -17,6 +17,8 @@ export interface ConfigType {
max_bio_size: number;
max_username_size: number;
max_note_size: number;
max_avatar_size: number;
max_header_size: number;
max_media_size: number;
max_media_attachments: number;
max_media_description_size: number;