-
Notifications
You must be signed in to change notification settings - Fork 577
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
Redesign user auth #2002
Redesign user auth #2002
Conversation
Hey - looks like you forgot to add a T:* label - could you please add one? 👍 |
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 this looks good and valuable.
lib/user-methods.js
Outdated
}, | ||
|
||
jwt(token) { | ||
return new Credentials('jwt', 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.
Should this take an optional provider
too?
@nirinchev I have connected your PR with #1579 which I believe is the correct issue. To me, it is important that we get something which is as close to our other SDKs as possible. |
I agree - this very closely mirrors the .NET API, which if I remember correctly is aligned with Cocoa and Java (maybe with a few casing differences). @cmelchior can you do a high level review and see if the new API diverges in significant ways from Java? |
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.
There are a few naming differences compared to Java, but the API seems to work the same way. To be honest, I like the names you picked more, and Swift uses the same names you picked here. I'm guessing Java's names are a leftover from an old design that was never refactored and is a (poor) attempt at papering over the difference between a token and a username.
@nirinchev The "pipeline" in zenhub tracks the state - doing that in the subject with "[WIP]" is redundant and not a scheme that is used by others either, so I've removed "[WIP]" :-) Other than that nitpick - looks good! |
CHANGELOG.md
Outdated
@@ -7,7 +7,23 @@ X.Y.Z Release notes | |||
* Realm Object Server: 3.0.0 or later | |||
|
|||
### Breaking changes | |||
* None. | |||
* The authentication API have been completely revamped. |
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.
"have" -> "has"
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 was using the plural version of API 🤓
docs/sync.js
Outdated
|
||
/** | ||
* Creates credentials based on a JWT login. | ||
* @param {string} token A Json Web Token, that will be validated against the server's configured rules. |
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.
"Json" -> "JSON"
The CI errors are |
What, How & Why?
This aligns the authentication API with the other SDKs.
☑️ ToDos
Compatibility
label is updated or copied from previous entryBreaking
label has been applied or is not necessaryIf this PR adds or changes public API's: