Skip to main content

load_oauth_token

Function load_oauth_token 

Source
pub fn load_oauth_token() -> Result<Option<OpenRouterToken>>
Expand description

Load an OAuth token from storage using the default mode.

This function attempts to load from the OS keyring first (the default). If no entry exists in the keyring, it falls back to file-based storage for backward compatibility. This allows seamless migration from file to keyring storage.

§Errors

Returns an error if:

  • Keyring access fails with an error other than “no entry found”
  • File access fails (and keyring had no entry)