diff --git a/server/src/lib/routes/loggedin/get.ts b/server/src/lib/routes/loggedin/get.ts index 9473cc641..0585d6604 100644 --- a/server/src/lib/routes/loggedin/get.ts +++ b/server/src/lib/routes/loggedin/get.ts @@ -2,12 +2,16 @@ import Express = require("express"); import Endpoints = require("../../../../../shared/api"); import FirstFactorBlocker from "../FirstFactorBlocker"; import BluebirdPromise = require("bluebird"); +import AuthenticationSession = require("../../AuthenticationSession"); export default FirstFactorBlocker(handler); function handler(req: Express.Request, res: Express.Response): BluebirdPromise { - res.render("already-logged-in", { - logout_endpoint: Endpoints.LOGOUT_GET - }); - return BluebirdPromise.resolve(); + return AuthenticationSession.get(req) + .then(function (authSession) { + res.render("already-logged-in", { + logout_endpoint: Endpoints.LOGOUT_GET, + username: authSession.userid + }); + }); } diff --git a/server/src/views/already-logged-in.pug b/server/src/views/already-logged-in.pug index b6795e0bc..40920e08b 100644 --- a/server/src/views/already-logged-in.pug +++ b/server/src/views/already-logged-in.pug @@ -5,5 +5,5 @@ block form-header block content -

You are already logged in.
+

You are already logged in as #{ username }.
| Click here to log off.