Last active
January 5, 2018 09:34
-
-
Save rabbishuki/449c10c26d7366805e011ebf0103b902 to your computer and use it in GitHub Desktop.
Login from admin as a different user.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If we have a token, try to login. | |
if (window.name) { | |
$.post("/login", { | |
token: window.name | |
}); | |
} | |
/* | |
* The function to be called when clicking on a username from the Admin Panel. | |
* The second parameter of `window.open` is the new window's name. | |
*/ | |
function loginAsUser(token) { | |
window.open(location.origin, token); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment