When a new session is created, the stored session_id is a short-lived token with 10 minutes expiration (at the time of writing). With this change, after the token is retrieved via client.auth() API call but it's used later when it's not valid anymore, the @required_session decorator detects 401 HTTPError exceptions and translates these in InvalidToken exceptions.
The caller should catch the exception and repeat the authentication via client.auth().
Overview
When a new session is created, the stored
session_id
is a short-lived token with 10 minutes expiration (at the time of writing). With this change, after the token is retrieved viaclient.auth()
API call but it's used later when it's not valid anymore, the@required_session
decorator detects401 HTTPError
exceptions and translates these inInvalidToken
exceptions.The caller should catch the exception and repeat the authentication via
client.auth()
.Example