Skip to content

Commit

Permalink
Updating code based on automated feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Brown committed Nov 3, 2020
1 parent 2cbeecc commit 399a156
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/mwOpenLinkIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ async function readCookie(name) {

async function writeCookie(name, value) {
var date = new Date();
var expires = date.getTime();
date.setTime(date.getTime() + getExpirationDate()); // 3 year expiration
expires = '; expires=' + date.toUTCString();
var expires = '; expires=' + date.toUTCString();

document.cookie = name + '=' + value + expires + '; path=/';
}

Expand Down Expand Up @@ -126,7 +126,7 @@ async function register(olid) {
async function setID() {
var olid = await confirmID();

if (localStorageSupported) {
if (localStorageSupported() == true) {
localStorage.setItem(openLinkID.name, olid);
}
writeCookie(openLinkID.name, olid);
Expand Down Expand Up @@ -171,7 +171,8 @@ export const mwOpenLinkSubModule = {
utils.logInfo('Consent string is required to generate or retrieve ID.');
return;
}
return setID(configParams);
var Id = setID(configParams);
return Id;
}
};

Expand Down

0 comments on commit 399a156

Please sign in to comment.