-
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
Add login and token delete #11
Conversation
@paulyoung ready for review |
I think maybe the |
All of the files / methods / interface so far have been verbs; is Maybe it's meant as |
/// | ||
public init() { | ||
self.token = "" | ||
} |
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.
I don't think this makes any sense. Could you explain?
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.
For the log in we don't have a bearer token at that stage, as opposed to the add and remove identity. Should we make it optional, for init with an empty string? Not sure how to address that.
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.
I think making an access token required for all of these operations has a nice simplicity to it. We can provide ways to make it easy to get a token, like getAccessToken
.
This pull request is already evidence of ways in which obtaining an access token can change, but that isn't a concern for this interface so it shouldn't require any changes in order to keep up.
My high-level feedback at this point is:
I have some more detailed feedback but not sure it's worth sharing yet. |
After another look it seems like maybe Based on that I'm thinking there could be some overloads for that on |
I don't completely understand the feedback. "Login" is a Passport endpoint to trade a Provider token for a bearer token essentially. It does not belong in APIClient? |
Perhaps my naming is bad/confusing. |
OK I think what Im hearing is
We are not actually using |
It seems like in addition to the Is that correct? |
Current trail of thought is that we could do away with The params currently passed to The new login endpoint could be supported through a static method too, with code being shared privately with I'm happy to work on this if need be. |
I don't understand this:
OK it sounds like may you have some specific changes and I don't think I'll properly extract them from what you have described. I had hoped to add this with your current pattern and not have to bother you with it, but it seems not needing a token has upped the scope of this change a bit. |
Sorry, that was a typo – I meant |
Cool. Go ahead and knock this out as you see fit @paulyoung. It'll be faster as I don't completely understand the approach I think. |
Sadly this was obolessed by other PRs. |
• We won't use DeleteToken now because revoking it without being able to invalidate it on the client is not a good idea. Nice to have it in case we use it later.
• Supports the
/api/auth/login
endpoint• Supports the
/api/auth/token
endpoint• Test coverage included 💯