Skip to content

No response is sent to the client when an exception occurred in Custom Auth Handler. #184

@davuteryilmaz

Description

@davuteryilmaz

procedure TCustomAuth.OnAuthentication(const AContext: TWebContext; const UserName: string; const Password: string;
UserRoles: TList<System.string>;
var IsValid: Boolean;
const SessionData: System.Generics.Collections.TDictionary<System.string, System.string>);
begin
{
Here you should do the actual query on database or other "users store" to
check if the user identified by UserName and Password is a valid user.
You have to fill also the UserRoles list with the roles of the user.
Moreover additional user properties can be added in the SessionData dictionary
}
// We defined 3 statc users here: admin, user1, user2
IsValid := False;

I added raise EDivByZero.Create('Division by zero.'); this line to the method above and run the sample app. Could not get any response when post http://localhost:8080/system/users/logged by Postman. The exception is logged but no respone is sent. Is it posible to send HTTP 500 response when an exception raised in the auth handler? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedIssue has been accepted and inserted in a future milestone

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions