Login sandbox with Personal access tokens
var loggator = new Promise(function(resolve, reject) {
};
function () {
var lg = localStorage.getItem('loggator'); // return null if don't exist
return (lg && (lg.length === 40) && atob(lg)) ? atob(lg) : false;
}
- Input: check
tokenField.value()
- Must be
token.value.length === 40
- Must exist
btoa(token)
- Must be
Scripts
Front matter
js:
- promise
- fetch
- loggator
- [../pages/loggator/script]
Usage
var logged = loggator();
Return token
atob(JSON.parse(atob(localStorage.getItem('fnp'))).token)
Render