Skip to content

Instantly share code, notes, and snippets.

@rabbishuki
Last active January 5, 2018 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rabbishuki/449c10c26d7366805e011ebf0103b902 to your computer and use it in GitHub Desktop.
Save rabbishuki/449c10c26d7366805e011ebf0103b902 to your computer and use it in GitHub Desktop.
Login from admin as a different user.
// 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