Created
July 12, 2016 18:30
-
-
Save russiann/0f2f2fb50d4fdb64d2fe67e5deb00114 to your computer and use it in GitHub Desktop.
fooo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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