Changelog - 2026-06-18
Current User Information Endpoint
New FeatureIn one line. If your auth service implements getUserInformation, the generated auth controller now serves it at GET /me, with no custom controller needed.
What changed
- New route
GET /me. Registered bydefineAuthController. It returns the result ofIAuthService.getUserInformation. GET /who-am-i?withUserInformation=true. The response gains auserInformationfield next to the JWT payload. The flag acceptstrue,false,1or0.- JWT-protected. Both need a valid access token (
Authentication.STRATEGY_JWT). 501 Not Implemented. Returned when the auth service does not implementgetUserInformation?(context, opts). The default/who-am-iresponse is unchanged.- Response schema. Set it with
payload.getUserInformation.response.schema. Thewho-am-iOpenAPI schema documents the optionaluserInformationfield.
typescript
class MyAuthService implements IAuthService {
async getUserInformation(context, _opts) {
const current = context.get(Authentication.CURRENT_USER);
return this.userRepository.findById({ id: current.userId });
}
}
defineAuthController({
// ...
payload: {
getUserInformation: { response: { schema: GetUserInformationResponseSchema } },
},
});Who is affected
- Apps without
getUserInformation. No action needed./meand/who-am-i?withUserInformation=truereturn501. - Apps that already implement it. No action needed. You now get
/meand the merge flag.