external login redirect, include logo images

This commit is contained in:
Evert Prants 2017-09-07 00:48:51 +03:00
parent 1d782a9b98
commit 05588560a6
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
7 changed files with 8 additions and 4 deletions

View File

@ -62,10 +62,7 @@ function createSession (req, user) {
if (req.session.redirectUri) { if (req.session.redirectUri) {
uri = req.session.redirectUri uri = req.session.redirectUri
delete req.session.redirectUri } else if (req.query.redirect) {
}
if (req.query.redirect) {
uri = req.query.redirect uri = req.query.redirect
} }

View File

@ -38,6 +38,8 @@ function setSession (req, user) {
function redirectLogin (req, res) { function redirectLogin (req, res) {
let uri = '/' let uri = '/'
console.log(req.session.redirectUri, req.session.csrf)
if (req.session.redirectUri) { if (req.session.redirectUri) {
uri = req.session.redirectUri uri = req.session.redirectUri
delete req.session.redirectUri delete req.session.redirectUri

View File

@ -20,6 +20,7 @@ router.use(oauthLimiter)
function ensureLoggedIn (req, res, next) { function ensureLoggedIn (req, res, next) {
if (req.session.user) return next() if (req.session.user) return next()
req.session.redirectUri = req.originalUrl req.session.redirectUri = req.originalUrl
console.log('set return uri', req.session.redirectUri, req.session.csrf)
res.redirect('/login') res.redirect('/login')
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
static/image/icynet.svgz Normal file

Binary file not shown.

View File

@ -51,6 +51,8 @@ html
a.scroll(href="/#home") Home a.scroll(href="/#home") Home
li.fullview li.fullview
a.scroll(href="/#news") News a.scroll(href="/#news") News
li.fullview
a(href="https://forum.icynet.eu/") Forum
ul.fullview.floating ul.fullview.floating
if user if user
li#user li#user
@ -69,6 +71,8 @@ html
a.scroll(href="/#home") Home a.scroll(href="/#home") Home
li li
a.scroll(href="/#news") News a.scroll(href="/#news") News
li
a(href="https://forum.icynet.eu/") Forum
.division .division
if user if user
li#user li#user