Skip to content

Commit

Permalink
Merge pull request #62 from andela/ch-save-token-localstorage-165412908
Browse files Browse the repository at this point in the history
#165412908 save token in the localstorage
  • Loading branch information
e-liyai committed May 31, 2019
2 parents 9d14459 + 85ddbe2 commit 8dee914
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/html/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ <h1 class="primary text-white radius-2 uppercase large-padding center-align">
if (result) {
document.querySelector('#response').innerHTML = JSON.stringify(result, null, 4)
}

if (result.token && result.user) {
localStorage.token = result.token;
localStorage.user = JSON.stringify(result.user);
}
}
}

Expand Down

0 comments on commit 8dee914

Please sign in to comment.