import {
    view,
    Injectable,
    BasicRegistrationAttempt,
    BasicLoginProvider,
    Valid,
    Controller,
} from '@extollo/lib'

/**
 * Registration Controller
 * ------------------------------------
 * Put some description here.
 */
@Injectable()
export class Registration extends Controller {
    public registration() {
        return view('auth:register')
    }

    public async register(attempt: Valid<BasicRegistrationAttempt>) {
        return this.make<BasicLoginProvider>(BasicLoginProvider)
            .attemptRegistration(attempt)
    }
}
