diff --git a/src/index.ts b/src/index.ts index b3ba4c3..6531359 100644 --- a/src/index.ts +++ b/src/index.ts @@ -127,6 +127,19 @@ export async function login( return result; } +/** + * Close the currently open session. + * + * You **must** be logged in to the portal before calling this method. + */ +export async function logout(): Promise { + // Check if the user is logged + if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); + + await shared.session.delete(); + shared.setIsLogged(false); +} + /** * Chek if exists a new version of the handiwork. *