lint fixes
This commit is contained in:
parent
94538bfaf4
commit
d98efc0433
7 changed files with 20 additions and 23 deletions
|
@ -77,20 +77,18 @@ export class AuthenticateController extends BaseController {
|
|||
});
|
||||
|
||||
this.App.post("/anonymLogin", (res: HttpResponse, req: HttpRequest) => {
|
||||
(async () => {
|
||||
this.addCorsHeaders(res);
|
||||
this.addCorsHeaders(res);
|
||||
|
||||
res.onAborted(() => {
|
||||
console.warn('Login request was aborted');
|
||||
})
|
||||
res.onAborted(() => {
|
||||
console.warn('Login request was aborted');
|
||||
})
|
||||
|
||||
const userUuid = v4();
|
||||
const authToken = jwtTokenManager.createJWTToken(userUuid);
|
||||
res.writeStatus("200 OK").end(JSON.stringify({
|
||||
authToken,
|
||||
userUuid,
|
||||
}));
|
||||
})();
|
||||
const userUuid = v4();
|
||||
const authToken = jwtTokenManager.createJWTToken(userUuid);
|
||||
res.writeStatus("200 OK").end(JSON.stringify({
|
||||
authToken,
|
||||
userUuid,
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ export class RoomIdentifier {
|
|||
public anonymous: boolean;
|
||||
public id:string
|
||||
constructor(roomID: string) {
|
||||
if (roomID.indexOf('_/') === 0) {
|
||||
if (roomID.startsWith('_/')) {
|
||||
this.anonymous = true;
|
||||
} else if(roomID.indexOf('@/') === 0) {
|
||||
} else if(roomID.startsWith('@/')) {
|
||||
this.anonymous = false;
|
||||
} else {
|
||||
throw new Error('Incorrect room ID: '+roomID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue