captcha-igid
Version:
Authorization service for an intergalactic session
52 lines (41 loc) • 1.19 kB
JavaScript
const {GeneralBusiness} = require('copious-transitions')
//
class CaptchaBusines extends GeneralBusiness {
//
constructor() {
super()
this.db = null
this.rules = null
this.mail_transport = null
this.mail_to_new_user = null
this.mail_to_forgetful_user = null
}
initialize(conf_obj,db) {
super.initialize(conf_obj,db)
}
//
process(use_case,post_body) {
switch ( use_case ) {
case "new-user" : {
if ( this.mail_to_new_user ) {
this.mail_to_new_user.emit('email_this',post_body.email)
}
break
}
default: {
return false
}
}
return true
}
cleanup(transition,pkey,post_body) {
if ( G_password_reset_trns.tagged(transition) ) {
this.del_recent_forgetfulness(pkey)
let whokey = post_body.who
this.db.del_static_store(whokey)
let tracking_num = post_body.trackable
this.db.del_key_value(tracking_num)
}
}
}
module.exports = new CaptchaBusines()