Skip to content

Create you own Auth

Olaf Erlandsen edited this page Jul 14, 2018 · 1 revision
export class AuthController extends Controller {
    public before () {
        if (!this.hasHeader("x-auth-token")) {
            return this.httpBadRequest();
        }
    }
}
@Api
export class MyApiController extends AuthController {
    @HttpGet("/users/:id")
    public get () {
        return this.httpOk();
    }
}
Clone this wiki locally