김재형

Implement dummy login path

......@@ -21,6 +21,7 @@
"react/display-name": "off",
"react/prop-types": "off",
"no-empty": ["warn", { "allowEmptyCatch": true }],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/interface-name-prefix": "off",
......
......@@ -67,6 +67,26 @@ createServer({
},
};
});
this.post("/users/login", (schema, request) => {
const body = JSON.parse(request.requestBody);
if (body.user_id === "admin" && body.password === "password") {
return {
status: 200,
data: {
access_token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
refresh_token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
expiration: "2020-05-14T07:23:24Z",
},
};
}
return {
status: 401,
message: "unauthorized",
};
});
},
seeds(server) {
......