File tree Expand file tree Collapse file tree 3 files changed +9
-14
lines changed Expand file tree Collapse file tree 3 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import fs from "fs";
5
5
import yaml from "yaml" ;
6
6
import swaggerUi from "swagger-ui-express" ;
7
7
8
- import userRoutes from "./routes/user-routes.js " ;
9
- import authRoutes from "./routes/auth-routes.js " ;
8
+ import userRoutes from "./routes/user-routes" ;
9
+ import authRoutes from "./routes/auth-routes" ;
10
10
11
11
dotenv . config ( ) ;
12
12
Original file line number Diff line number Diff line change 1
1
import { Response } from "express" ;
2
2
import bcrypt from "bcrypt" ;
3
3
import jwt from "jsonwebtoken" ;
4
- import { findUserByEmail as _findUserByEmail } from "../model/repository.js " ;
5
- import { formatUserResponse } from "./user-controller.js " ;
6
- import { AuthenticatedRequest } from "../types/request.js " ;
4
+ import { findUserByEmail as _findUserByEmail } from "../model/repository" ;
5
+ import { formatUserResponse } from "./user-controller" ;
6
+ import { AuthenticatedRequest } from "../types/request" ;
7
7
8
- export async function handleLogin (
9
- req : AuthenticatedRequest ,
10
- res : Response
11
- ) : Promise < Response > {
8
+ export async function handleLogin ( req : AuthenticatedRequest , res : Response ) : Promise < Response > {
12
9
const { email, password } = req . body ;
13
10
if ( email && password ) {
14
11
try {
@@ -49,9 +46,7 @@ export async function handleVerifyToken(
49
46
) : Promise < Response > {
50
47
try {
51
48
const verifiedUser = req . user ;
52
- return res
53
- . status ( 200 )
54
- . json ( { message : "Token verified" , data : verifiedUser } ) ;
49
+ return res . status ( 200 ) . json ( { message : "Token verified" , data : verifiedUser } ) ;
55
50
} catch ( err ) {
56
51
return res . status ( 500 ) . json ( { message : "Server error" , err } ) ;
57
52
}
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ import {
7
7
getUser ,
8
8
updateUser ,
9
9
updateUserPrivilege ,
10
- } from "../controller/user-controller.js " ;
10
+ } from "../controller/user-controller" ;
11
11
import {
12
12
verifyAccessToken ,
13
13
verifyIsAdmin ,
14
14
verifyIsOwnerOrAdmin ,
15
- } from "../middleware/basic-access-control.js " ;
15
+ } from "../middleware/basic-access-control" ;
16
16
17
17
const router = express . Router ( ) ;
18
18
You can’t perform that action at this time.
0 commit comments