Add logout endpoint

This commit is contained in:
bytedream 2022-06-21 22:04:22 +02:00
parent f71846628d
commit 2067c50937

View file

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