Skip to content

Instantly share code, notes, and snippets.

@russiann
Created July 12, 2016 18:30
Show Gist options
  • Save russiann/0f2f2fb50d4fdb64d2fe67e5deb00114 to your computer and use it in GitHub Desktop.
Save russiann/0f2f2fb50d4fdb64d2fe67e5deb00114 to your computer and use it in GitHub Desktop.
fooo
class AdminLogin {
setup(app) {
this.app = app;
}
create(data) {
return new Promise((resolve, reject) => {
this.app.authenticate({
type: 'loca',
email: data.email,
password: data.password
})
.then(res => {
if(res.role === 'admin') {
resolve(res)
} else {
// retorna erro
// ...
}
})
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment