Skip to content

Commit

Permalink
updates the Auth file to allow for getUserContent function to get dat…
Browse files Browse the repository at this point in the history
…e time of accepted consent agreement
  • Loading branch information
Segerlu committed Oct 11, 2023
1 parent 7df2a67 commit 5ad249a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dod-advana/advana-platform-ui",
"version": "2.8.1",
"version": "2.8.2",
"private": false,
"main": "dist/index.js",
"repository": {
Expand Down
11 changes: 11 additions & 0 deletions src/lib/utilities/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ class Auth {
else { return null; }
}

/**
* Gets the local date/time the user accepted the consent agreement in the
* current session. If the consent agreement has not been accepted, this
* returns null.
* @returns {Date}
*/
static getUserConsent() {
const timestamp = this.getTokenPayload()?.consent;
return !timestamp ? null : new Date(timestamp);
}

static userDisabled() {
const tokenPayload = this.getTokenPayload();
if (tokenPayload != null) {
Expand Down

0 comments on commit 5ad249a

Please sign in to comment.