diff --git a/crunchyroll.go b/crunchyroll.go index 214cbe4..9c786c6 100644 --- a/crunchyroll.go +++ b/crunchyroll.go @@ -250,6 +250,16 @@ type Crunchyroll struct { cache bool } +// Logout logs the user out which invalidates the current session. +// You have to call a login method again and create a new Crunchyroll instance +// if you want to perform any further actions since this instance is not usable +// anymore after calling this. +func (c *Crunchyroll) Logout() error { + endpoint := "https://crunchyroll.com/logout" + _, err := c.request(endpoint, http.MethodGet) + return err +} + // IsCaching returns if data gets cached or not. // See SetCaching for more information. func (c *Crunchyroll) IsCaching() bool {