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

Avoid response where 'expiresIn' could be negative #107

Merged
merged 1 commit into from
Sep 15, 2016

Conversation

nremond
Copy link
Contributor

@nremond nremond commented Sep 14, 2016

Hello,

In the current process, it is first checked that a token.isExpired and then, the token.expiresIn is recalculated with a new time.
As such, it is possible to have a negative value.


def expiresIn: Option[Long] = expirationTimeInMilis map { expTime =>
lazy val expiresIn: Option[Long] = expirationTimeInMilis map { expTime =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need lazy? If recalculated is not good, it seems we should calculate expiresIn with instantiation.

@nremond
Copy link
Contributor Author

nremond commented Sep 15, 2016

Agreed. I've updated my code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants