danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

davuteryilmaz opened this issue · comments

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.

Will be fixed in 3.1.1-beryllium-RC3