Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

💡 Token Hash #85

codefiesta started this conversation in Ideas
Discussion options

I'm wondering if it would be valuable to provide an observable hash of Providers and their respective Authorization tokens for easy access to multiple tokens inside the OAuth object:

@Observable class OAuth {
 public var authorizations: [Provider: Authorization] = [:]
}

Or, change the OAuth.State.authorized state from a single authorization to an accumulated hash of multiple authorizations:

/// Current implementation (single)
case authorized(Provider, Authorization)
/// Proposed change (multiple)
case authorized([Provider: Authorization])

This could allow applications to easily authenticate with multiple providers and stay in line with the current observer pattern. The first option wouldn't be a breaking change, however it could make for messier implementations for developers of knowing what to truly observe and react to.

Obviously changing the state signature would be a breaking change.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
enhancement New feature or request
1 participant

AltStyle によって変換されたページ (->オリジナル) /