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

Token check #4025

Merged
merged 5 commits into from
Nov 28, 2019
Merged

Token check #4025

merged 5 commits into from
Nov 28, 2019

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Nov 19, 2019

Resolves brave/brave-browser#7022

Submitter Checklist:

Test Plan:

covered with tests

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

Copy link
Collaborator

@kylehickinson kylehickinson left a comment

Choose a reason for hiding this comment

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

Waiting on #4087 for iOS implementation.

@NejcZdovc NejcZdovc force-pushed the token-check branch 2 times, most recently from 41c7fa0 to f44ae4a Compare November 27, 2019 22:39
@tmancey tmancey self-requested a review November 28, 2019 09:30

const uint64_t now = static_cast<uint64_t>(base::Time::Now().ToDoubleT());

return token->expires_at > 0 && token->expires_at < now;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: now should be checked with <=

Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

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

LGTM++

@NejcZdovc NejcZdovc merged commit 713bcf3 into master Nov 28, 2019
@NejcZdovc NejcZdovc deleted the token-check branch November 28, 2019 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if token expired before using it
6 participants