Linting app
This commit is contained in:
parent
b485c9bf46
commit
432b4a0e85
7 changed files with 46 additions and 42 deletions
|
@ -39,20 +39,22 @@ export class AuthenticateController extends BaseController {
|
|||
res.end();
|
||||
});
|
||||
|
||||
this.App.post("/login", async (res: HttpResponse, req: HttpRequest) => {
|
||||
this.addCorsHeaders(res);
|
||||
this.App.post("/login", (res: HttpResponse, req: HttpRequest) => {
|
||||
(async () => {
|
||||
this.addCorsHeaders(res);
|
||||
|
||||
res.onAborted(() => {
|
||||
console.warn('Login request was aborted');
|
||||
})
|
||||
const param = await res.json();
|
||||
const userUuid = uuid();
|
||||
const token = Jwt.sign({name: param.name, userUuid: userUuid} as TokenInterface, SECRET_KEY, {expiresIn: '24h'});
|
||||
res.writeStatus("200 OK").end(JSON.stringify({
|
||||
token: token,
|
||||
mapUrlStart: URL_ROOM_STARTED,
|
||||
userId: userUuid,
|
||||
}));
|
||||
res.onAborted(() => {
|
||||
console.warn('Login request was aborted');
|
||||
})
|
||||
const param = await res.json();
|
||||
const userUuid = uuid();
|
||||
const token = Jwt.sign({name: param.name, userUuid: userUuid} as TokenInterface, SECRET_KEY, {expiresIn: '24h'});
|
||||
res.writeStatus("200 OK").end(JSON.stringify({
|
||||
token: token,
|
||||
mapUrlStart: URL_ROOM_STARTED,
|
||||
userId: userUuid,
|
||||
}));
|
||||
})();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue