Skip to content

Refresh during network loss causes ASWebAuthenticationSession to show up again #58

Description

@nylki

Hi there,

This is less of a feature request or bug, but more of question.
I observed that when the refresh is being called during a network outage (or airplane mode) clearLogin() is called, due to the network error.
This in effect causes the ASWebAuthenticationSession sheet to re-appear (i think).

Well, what I was wondering how best to handle these situations with OAuthenticator, if already possible.
I suppose I could check inside my storeLogin if the login to be stored is invalid and then simply decide not to store it?
But this feels like an antipattern somehow, because at that point I cannot reason about the cause of the invalid login. Is there a better way to discard certain errors and not handle them as invalid logins, so that future calls/retries to the refresh can be succesful, without the user having to manually log-in again?

Another way would be to simply not do any network calls in such situations in the first place of course, which is what I am currently considering. But in my opinion it could be useful to treat specific errors as recoverable/retrieable in terms of refresh.

thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions