|
|
@ -186,21 +186,28 @@ func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Multi-user instance
|
|
|
|
// Multi-user instance
|
|
|
|
u := getUserSession(app, r) |
|
|
|
forceLanding := r.FormValue("landing") == "1" |
|
|
|
if u != nil { |
|
|
|
if !forceLanding { |
|
|
|
// User is logged in, so show the Pad
|
|
|
|
// Show correct page based on user auth status and configured landing path
|
|
|
|
return handleViewPad(app, w, r) |
|
|
|
u := getUserSession(app, r) |
|
|
|
} |
|
|
|
if u != nil { |
|
|
|
|
|
|
|
// User is logged in, so show the Pad
|
|
|
|
|
|
|
|
return handleViewPad(app, w, r) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if land := app.cfg.App.LandingPath(); land != "/" { |
|
|
|
if land := app.cfg.App.LandingPath(); land != "/" { |
|
|
|
return impart.HTTPError{http.StatusFound, land} |
|
|
|
return impart.HTTPError{http.StatusFound, land} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
p := struct { |
|
|
|
p := struct { |
|
|
|
page.StaticPage |
|
|
|
page.StaticPage |
|
|
|
Flashes []template.HTML |
|
|
|
Flashes []template.HTML |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ForcedLanding bool |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
StaticPage: pageForReq(app, r), |
|
|
|
StaticPage: pageForReq(app, r), |
|
|
|
|
|
|
|
ForcedLanding: forceLanding, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get error messages
|
|
|
|
// Get error messages
|
|
|
|