You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-12-07 23:23:49 +02:00
implementing logout
This commit is contained in:
@@ -9,6 +9,7 @@ import {RenderingMWs} from "../middlewares/RenderingMWs";
|
||||
export class UserRouter {
|
||||
constructor(private app) {
|
||||
this.addLogin();
|
||||
this.addLogout();
|
||||
this.addGetSessionUser();
|
||||
this.addChangePassword();
|
||||
|
||||
@@ -27,6 +28,15 @@ export class UserRouter {
|
||||
);
|
||||
};
|
||||
|
||||
private addLogout() {
|
||||
this.app.post("/api/user/logout",
|
||||
AuthenticationMWs.authenticate,
|
||||
AuthenticationMWs.logout,
|
||||
RenderingMWs.renderOK
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
private addGetSessionUser() {
|
||||
this.app.get("/api/user/login",
|
||||
AuthenticationMWs.authenticate,
|
||||
|
||||
Reference in New Issue
Block a user