Have got logout working

This commit is contained in:
Leon Mika 2026-02-25 22:30:28 +11:00
parent 01c6e9de87
commit b7e0269e9d
7 changed files with 66 additions and 10 deletions

View file

@ -0,0 +1,9 @@
import { Controller } from "@hotwired/stimulus"
export default class LogoutController extends Controller {
async logout(ev) {
ev.preventDefault();
await fetch(`/logout`, { method: 'POST' });
window.location.href = '/login';
}
}