logout button
This commit is contained in:
parent
58709501ca
commit
4e4757bac5
4 changed files with 18 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
export const preferencesLink = '/settings/preferences';
|
||||
export const profileLink = '/settings/profile';
|
||||
export const signOutLink = '/auth/sign_out';
|
||||
export const signOutLink = '/logout.html';
|
||||
export const privacyPolicyLink = '/privacy-policy';
|
||||
export const accountAdminLink = (id) => `/admin/accounts/${id}`;
|
||||
export const statusAdminLink = (account_id, status_id) => `/admin/accounts/${account_id}/statuses/${status_id}`;
|
||||
|
|
|
@ -25,7 +25,7 @@ export const logOut = () => {
|
|||
submitButton.setAttribute('type', 'submit');
|
||||
form.appendChild(submitButton);
|
||||
|
||||
form.method = 'post';
|
||||
form.method = 'get';
|
||||
form.action = signOutLink;
|
||||
form.style.display = 'none';
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ export const logOut = () => {
|
|||
submitButton.setAttribute('type', 'submit');
|
||||
form.appendChild(submitButton);
|
||||
|
||||
form.method = 'post';
|
||||
form.action = '/auth/sign_out';
|
||||
form.method = 'get';
|
||||
form.action = '/logout.html';
|
||||
form.style.display = 'none';
|
||||
|
||||
document.body.appendChild(form);
|
||||
|
|
14
public/logout.html
Normal file
14
public/logout.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Logout | Masto-FE standalone</title>
|
||||
<script>
|
||||
localStorage.clear();
|
||||
window.location.href = "/login.html";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
Clearing local storage and redirecting back to <a href="/login.html">login</a>...
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue