|
|
@@ -4,7 +4,7 @@ import { UserService } from '../modules/users/user.service';
|
|
|
import { AppDataSource } from '../data-source';
|
|
|
import { AuthContext } from '../types/context';
|
|
|
import { parseWithAwait } from '../utils/parseWithAwait';
|
|
|
-import { UserSchema } from '../modules/users/user.schema';
|
|
|
+import { AuthUserSchema } from '../modules/users/user.schema';
|
|
|
|
|
|
export async function authMiddleware(c: Context<AuthContext>, next: Next) {
|
|
|
try {
|
|
|
@@ -28,7 +28,7 @@ export async function authMiddleware(c: Context<AuthContext>, next: Next) {
|
|
|
return c.json({ message: 'User not found' }, 401);
|
|
|
}
|
|
|
|
|
|
- c.set('user', await parseWithAwait(UserSchema, user));
|
|
|
+ c.set('user', await parseWithAwait(AuthUserSchema, user));
|
|
|
c.set('token', token);
|
|
|
await next();
|
|
|
} catch (error) {
|