1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

login, signup: redirect to dashboard if logged in

Fixes https://gitlab.com/commento/commento-ce/issues/60
This commit is contained in:
Adhityaa Chandrasekar
2018-08-08 11:38:16 +05:30
parent 97d3d556e6
commit ee324c1f28
3 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,14 @@
(function (global, document) {
// Redirect the user to the dashboard if there's a cookie. If the cookie is
// invalid, they would be redirected back to the login page *after* the
// cookie is deleted.
global.loggedInRedirect = function() {
if (global.cookieGet("commentoOwnerToken") !== undefined)
document.location = "/dashboard";
}
// Prefills the email field from the URL parameter.
global.prefillEmail = function() {
if (paramGet("email") != undefined) {