I used the Power Tool to create an entity. I am able to add a record in my table using the GUI generated when I am logged in.
I have a new registration form, and I want to add a record in my table at registration time - before the user has logged in. In method 'public async Task<RegisterTenantOutput> RegisterTenant(RegisterTenantInput input)' I call the 'CreateOrEdit' method of 'IInstitutionsAppService', as follows:
await _institutionsAppService.CreateOrEdit(
new TtmDataModel.Dtos.CreateOrEditInstitutionDto()
{
DomainName = emailDomain,
InstitutionName = institutionName,
TenantId = tenant.Id,
IsSet_ = 0,
Id = null,
});
Invoking the method results in an Exception being thrown. Exception.message: "Current user did not login to the application!"
Can you direct me to the documentation that will explain how to create and edit my custom table records without the user being logged in? Or if there is no documentation, please explain how to accomplish this objective. Thank you.
1 Answer(s)
-
0
Hi @timmackey
If you don't want to authorize a specific app service method, you can add AbpAllowAnonymous attribute to that method.
For more info, you can check https://aspnetboilerplate.com/Pages/Documents/Authorization