Tokens are currently stored in the UserDefaults dictionary, which is highly discouraged to store sensitive data such as authentication tokens.
Switch to storing tokens using URLCredentialStorage (which stores permanent credentials in the keychain) or the keychain itself to store tokens.