class Auth
{
static login(ctx, next)
{
var Login = function() {
return new Promise( (resolve, reject) => {
setTimeout(function() {
resolve()
},2000)
})
}
var login = Login()
login.then(() =>
{
console.log('resolved..')
ctx.body = 'logged in'
})
.catch(() =>
{
console.log('rejected')
})
}
}