logout button

This commit is contained in:
Laura Hausmann 2023-10-09 18:25:20 +02:00
parent 58709501ca
commit 4e4757bac5
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
4 changed files with 18 additions and 4 deletions

View file

@ -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}`;

View file

@ -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';

View file

@ -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
View 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>