Completely getting rid of "userid"
Previously, userid was generated by the "/login" route and passed along. This commit completely removes the uuid "userid" (and disables the LoginController too and any Jwt check). "userid" is replaced by the "socket id" of the connection. So a user is now identified using a socket id, which is unique for a given connection.
This commit is contained in:
@@ -4,7 +4,7 @@ import {BAD_REQUEST, OK} from "http-status-codes";
|
||||
import {SECRET_KEY, URL_ROOM_STARTED} from "../Enum/EnvironmentVariable"; //TODO fix import by "_Enum/..."
|
||||
import { uuid } from 'uuidv4';
|
||||
|
||||
export class AuthenticateController{
|
||||
export class AuthenticateController {
|
||||
App : Application;
|
||||
|
||||
constructor(App : Application) {
|
||||
@@ -14,7 +14,8 @@ export class AuthenticateController{
|
||||
|
||||
//permit to login on application. Return token to connect on Websocket IO.
|
||||
login(){
|
||||
this.App.post("/login", (req: Request, res: Response) => {
|
||||
// For now, let's completely forget the /login route.
|
||||
/*this.App.post("/login", (req: Request, res: Response) => {
|
||||
let param = req.body;
|
||||
if(!param.email){
|
||||
return res.status(BAD_REQUEST).send({
|
||||
@@ -29,6 +30,6 @@ export class AuthenticateController{
|
||||
mapUrlStart: URL_ROOM_STARTED,
|
||||
userId: userId,
|
||||
});
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user