The best way is to have 2 html templates and to return with the proper content based on the login info passed.
You do not need 2 actions for this, only one:
procedure TFPWebModule1.DoLoginRequest(Sender: TObject; ARequest: TRequest;
AResponse: TResponse; var Handled: Boolean);
begin //Template:TFPTemplate is a property of the web Action
Handled := true;
Template.AllowTagParams := true;
Template.FileName := 'pathtotemplate/login.html';
Template.OnReplaceTag := @loginscreenlReplaceTags;
if There-Are-No-Login-Name-And-Password-In-The-Passed-ContentFields then
begin//just show the initial empty login-form screen
AResponse.Content := Template.GetContent;
Exit;
end;
{
... decide if login attempt successful
}
if LoginSuccesful then
begin//use the welcome screen template
Template.FileName := 'pathtotemplate/welcome.html'
Template.OnReplaceTag := @welcomescreenlReplaceTags;
end;
AResponse.Content := Template.GetContent;
end;
Of course, you need both welcomescreenlReplaceTags and loginscreenlReplaceTags to be there to handle the template tags if there are any.
Inside loginscreenlReplaceTags for example you can put a message out to the form on unsuccesful login, and maybe fill out the login name field when returning the form, so it does not have to be filled out again by the visitor. Etc.