import { client, navigateTo } from "../../index.js";
import AbstractAuthentifiedView from "../abstracts/AbstractAuthentifiedView.js";

export default class extends AbstractAuthentifiedView
{
	constructor(params, lastPageUrl = '/login') {
		super(params, "Logout");
		this.lastPageUrl = lastPageUrl;
	}

	async postInit() {
		await client.logout();
		await client.notice.disconnect();
		navigateTo(this.lastPageUrl);
	}
}
