currently we have github.benslabbert.vdw.codegen.annotation.auth.HasRole and github.benslabbert.vdw.codegen.annotation.auth.NoAuthCheck for routes
add a new annotation @IsAuthenticated
which simply checks that there is a user associated with the current request
User user = ctx.user();
if (null == user) {
// not authenticated
ctx.response().setStatusCode(401).end();
return;
}
// rest of the code
handler code can then safely access the user and do whatever it wants to do with it
@WebRequest.IsAuthenticated
void all(@WebRequest.RoutingContext RoutingContext ctx) {
User user = ctx.user();
// safe to use user
Authorizations authorizations = user.authorizations();
}
currently we have github.benslabbert.vdw.codegen.annotation.auth.HasRole and github.benslabbert.vdw.codegen.annotation.auth.NoAuthCheck for routes
add a new annotation
@IsAuthenticatedwhich simply checks that there is a user associated with the current request
handler code can then safely access the user and do whatever it wants to do with it