Skip to content

Instantly share code, notes, and snippets.

@digitaltim-de
Created August 6, 2019 15:50
Show Gist options
  • Save digitaltim-de/89d788d54380df01081ca21235bb89fd to your computer and use it in GitHub Desktop.
Save digitaltim-de/89d788d54380df01081ca21235bb89fd to your computer and use it in GitHub Desktop.
const Noty = require('noty');
function api_login_check(response) {
// If we become a Acces Token back - Login Correct
if (response.data.access_token.length===0) {
localStorage.setItem('acces_token', response.data.access_token);
window.location.href = '../html/dashboard.html';
} else {
new Noty({text: 'Some notification text'}).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment