김재형

Implement dummy login path

...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
21 "react/display-name": "off", 21 "react/display-name": "off",
22 "react/prop-types": "off", 22 "react/prop-types": "off",
23 "no-empty": ["warn", { "allowEmptyCatch": true }], 23 "no-empty": ["warn", { "allowEmptyCatch": true }],
24 + "@typescript-eslint/camelcase": "off",
24 "@typescript-eslint/explicit-function-return-type": "off", 25 "@typescript-eslint/explicit-function-return-type": "off",
25 "@typescript-eslint/explicit-member-accessibility": "off", 26 "@typescript-eslint/explicit-member-accessibility": "off",
26 "@typescript-eslint/interface-name-prefix": "off", 27 "@typescript-eslint/interface-name-prefix": "off",
......
...@@ -67,6 +67,26 @@ createServer({ ...@@ -67,6 +67,26 @@ createServer({
67 }, 67 },
68 }; 68 };
69 }); 69 });
70 +
71 + this.post("/users/login", (schema, request) => {
72 + const body = JSON.parse(request.requestBody);
73 + if (body.user_id === "admin" && body.password === "password") {
74 + return {
75 + status: 200,
76 + data: {
77 + access_token:
78 + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
79 + refresh_token:
80 + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
81 + expiration: "2020-05-14T07:23:24Z",
82 + },
83 + };
84 + }
85 + return {
86 + status: 401,
87 + message: "unauthorized",
88 + };
89 + });
70 }, 90 },
71 91
72 seeds(server) { 92 seeds(server) {
......