Skip to content

Log in again when the device rejects the session - #63

Open
antoniovazquezblanco wants to merge 1 commit into
puddly:devfrom
antoniovazquezblanco:auto-relogin
Open

antoniovazquezblanco wants to merge 1 commit into
puddly:devfrom
antoniovazquezblanco:auto-relogin

Conversation

@antoniovazquezblanco

Copy link
Copy Markdown
Contributor

With keep_credentials=True, a request that gets a 401 now logs in again with the kept credentials and is sent once more. The device rejects it in its auth middleware before running it, so nothing runs twice. This covers API calls, the start of a stream and WebSocket handshakes, but not uploads, whose body cannot be sent twice.

The renewal keeps the session generation, since the account is the same, so operations in progress carry on. Calls that lose the session together share one login, and a login or logout by the caller still wins. Rejected credentials are dropped and raise
NanoKVMAuthenticationFailure; an unreachable device raises its error and the next call tries again.

With keep_credentials=True, a request that gets a 401 now logs in again
with the kept credentials and is sent once more. The device rejects it
in its auth middleware before running it, so nothing runs twice. This
covers API calls, the start of a stream and WebSocket handshakes, but
not uploads, whose body cannot be sent twice.

The renewal keeps the session generation, since the account is the
same, so operations in progress carry on. Calls that lose the session
together share one login, and a login or logout by the caller still
wins. Rejected credentials are dropped and raise
NanoKVMAuthenticationFailure; an unreachable device raises its error and
the next call tries again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant