-
Notifications
You must be signed in to change notification settings - Fork 231
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
Expose recovery code [SDK-2661] #487
Conversation
|
||
@objc public init(accessToken: String? = nil, tokenType: String? = nil, idToken: String? = nil, refreshToken: String? = nil, expiresIn: Date? = nil, scope: String? = nil) { | ||
@objc public init(accessToken: String? = nil, tokenType: String? = nil, idToken: String? = nil, refreshToken: String? = nil, expiresIn: Date? = nil, scope: String? = nil, recoveryCode: String? = nil) { |
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.
@Widcket Given that this class and constructor is public. If someone is instantiating a Credentials
object today without using named parameters, wouldn't this change be a breaking change?
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.
No, check the tests. When the value is not provided, it ends up as nil
.
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.
@Widcket The tests in CredentialsSpec.swift
all use the constructor that takes a json
input.
If not that file, what is the file I should be checking that makes use of the alternate constructor that takes all the arguments?
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.
The JSON constructor is calling the one with the parameters: /~https://github.com/auth0/Auth0.swift/blob/master/Auth0/Credentials.swift#L68
If someone is instantiating a Credentials object today without using named parameters
The parameter is expressed as recoveryCode: String? = nil
, so there's no instantiating it without named parameters. The parameters are there, even if you do Credentials()
:
Changes
The documentation for the Verify with Recovery Code endpoint states that the response might include a new
recovery_code
that the app should display to the user. TheCredentials
class currently does not include that field, so it is not exposed to the developer.Testing
Unit tests were added, and the change was also tested manually on an iOS simulator:
Checklist