Skip to content
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

Credentials expiration date is not set since the expires_in value is an Int64 #439

Closed
seanmcneil opened this issue Jan 19, 2021 · 2 comments
Labels
needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue

Comments

@seanmcneil
Copy link
Contributor

Describe the problem

The expiration date is not being set for the Credentials object upon initialization since the provided data type is not handled.

credentials

What was the expected behavior?

I expect the Credentials object to set a valid expiration date.

Reproduction

Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent.

  • Step 1 Authenticate
  • Step 2 Examine initialization of Credentials object in
  • convenience required public init(json: [String: Any]) { }

Can the behavior be reproduced using the Auth0.swift sample app?

Environment

Please provide the following:

  • 1.30.1
  • 14.2
  • 12.2

I have a PR ready that resolves this and will publish shortly.

@seanmcneil
Copy link
Contributor Author

seanmcneil commented Jan 19, 2021

I've also found that there appears to be another issue going on with this.

While I can test the code snippet independently in a playground and it works, or the associated tests all pass, it fails when I pull the pod into my project. I tracked the issue down to an unusual error with instantiating a Date object, thus preventing it from modifying the date.

It turns out, that possibly due to the @objc compatibility, the class cannot use Date, but must instead use NSDate. I found that by changing the relevant data types to match NSDate, that only then would it successfully produce an expiration date. This is not connected to the issue I saw or the work I did. The class simply cannot access Date.

With that said, the pod in its current form still fails for me. I could convert my work to use NSDate, but am not sure if there is something I may be missing here?

Screen Shot 2021-01-19 at 2 06 05 PM

My branch that addresses the NSDate issue:
https://github.com/seanmcneil/Auth0.swift/tree/issue/nsdate

@Widcket Widcket added the needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue label Jan 29, 2021
@Widcket
Copy link
Contributor

Widcket commented Feb 10, 2021

Fixed in #440

@Widcket Widcket closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue
Projects
None yet
Development

No branches or pull requests

2 participants