-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove OAuth client and migrate functionality to static methods. #12
Conversation
@@ -2,6 +2,7 @@ import Swish | |||
|
|||
/// An API client for Passport. | |||
public struct APIClient { | |||
static let auth = Swish.APIClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is probably a bit misleading since it's really for making unauthorized requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you would name it. client
is pretty generic.
Hold the phone @paulyoung I see something to take a look at... |
Check out https://github.com/nickvelloff/Disc/blob/login-logout/Disc/Networking/Resources/User/LoginIdentity.swift#L36-L80 |
context("not specifying scopes or a provider") { | ||
it("should result in login URL") { | ||
let url = oauth.createLoginUrl() | ||
let url = APIClient.createLoginUrl(clientId: clientId, redirectUri: redirectUri) | ||
|
||
let expectedUrlString = "https://passport.thegrid.io/login/authorize" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old endpoint (OAuth passport) URL
This doesn't address any of the new functionality, only what already existed.
Make sense? |
I planned to create another pull request for the new endpoints. |
Ohh got it. Cool then it looks great. 🚢 |
Remove OAuth client and migrate functionality to static methods.
This is the first part to what was outlined in #11 (comment).
@nickvelloff please review 🙏