1
mirror of https://gitlab.com/commento/commento.git synced 2025-04-29 06:50:28 -04:00
commento/frontend/js/auth-common.js
2018-12-20 00:50:00 -05:00

21 lines
622 B
JavaScript

(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 = global.origin + "/dashboard";
}
// Prefills the email field from the URL parameter.
global.prefillEmail = function() {
if (paramGet("email") != undefined) {
$("#email").val(paramGet("email"));
$("#password").click();
}
};
} (window.commento, document));