From: Diogo Franco (Kovensky) Date: Mon, 15 Jul 2013 04:25:55 +0000 (-0300) Subject: anidb: Always remove credentials on Logout() X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=69d97ec2b2927a6705f90708db0f7da4431a24dd;p=go-anidb.git anidb: Always remove credentials on Logout() Even if they were never used. --- diff --git a/auth.go b/auth.go index de355f1..a4058a9 100644 --- a/auth.go +++ b/auth.go @@ -119,10 +119,10 @@ func (adb *AniDB) Auth(username, password, udpKey string) (err error) { // Logs the user out and removes the credentials from the AniDB struct. func (adb *AniDB) Logout() error { - if adb.udp.connected { - adb.udp.credentials.shred() - adb.udp.credentials = nil + adb.udp.credentials.shred() + adb.udp.credentials = nil + if adb.udp.connected { adb.udp.connected = false return adb.udp.Logout() }