Skip to content
Snippets Groups Projects
Commit d3773710 authored by Renzo Beux's avatar Renzo Beux
Browse files

fixes

parent 56be8b5f
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ import { validate } from '../Services/UserAPI';
const authChecker = async (req: any, res: Response, next: NextFunction) => {
try {
const token = req.headers.authorization;
const userId = await validate(token);
const { userId } = await validate(token) as { userId: number };
req.user_id = userId;
next();
} catch (error) {
......
......@@ -13,7 +13,7 @@ const instance = axios.create({
export const validate = async (token: string) => {
const id = await instance.post('/validate', { token });
return id;
return id.data;
};
const create = async (user: any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment