- ABP Framework version: v7.0.2
- UI type: Blazor
- DB provider: EMongoDB
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
I had a few questions about the User Aggregate and Login:
- I would like to ask for the User's Full name at the time of registration. How would I do this?
- I would also like to remove the username and use the email address as the username.
- When a user registers, I would like to create a stripe "customer" and store that as part of the User object.
Thank you
8 Answer(s)
-
0
Hi,
You should customize the registration page for your case: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface
The Register page is MVC UI
-
0
Which one of the three questions are answering with that link? Number 1?
Updating the UI is not really a problem, but those changes would have to flow through the system to the database. During registration, only the username, email address, and password will be sent back to the AccountApp service. I would need to include the First and Surname of the user. Would I have to extend the current AccountAppService and override the RegisterAsync method? [Edit] I just looked at the RegisterDto, it doesn't include First or Surname of the user.
For my 3rd question, for extending the UserIdentity, I can just use SetProperty on the IdentityUser, I believe since I am using MongoDb, it should make a difference in regards to searching by the stripeId as it should just add a property onto the document... correct?
-
0
Which one of the three questions are answering with that link? Number 1?
All questions, RegisterDto is extensible, you can set any properties you need.
I would need to include the First and Surname of the user. Would I have to extend the current AccountAppService and override the RegisterAsync method
Yes, you have to.
For my 3rd question, for extending the UserIdentity, I can just use SetProperty on the IdentityUser, I believe since I am using MongoDb, it should make a difference in regards to searching by the stripeId as it should just add a property onto the document... correct?
For MongoDB, they are stored as separate fields of the document. https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities#extra-properties
For example:
var builder = Builders<IdentityUser>.Filter; var query = builder.Eq("stripeId", Value); var users = await (await userRepository.GetCollectionAsync()).Find(query).ToListAsync();
-
0
Thanks...
There are several places in the UI that uses first name. So I am assuming that I would have to override all of those components with new ones as in https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components?UI=BlazorServer
ABP has excellent localization support. But I believe not using FullName might be a miss. The concept of surname and name changes quite a bit depending on local. Certain parts of Europe, Latin America, East Asia, etc don't use the standard name, surname format.
Also is there anyway to query ExtraProperties using the default repositories? I am assuming I would have to create a MyIdentityUserRepository that inherits from IdentityUserRepository and override the GetListAsync method or Add my own GetListWithExtraAsync and include stripeId and fullName, for example.
-
0
There are several places in the UI that uses first name. So I am assuming that I would have to override all of those components with new ones as in https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components?UI=BlazorServer ABP has excellent localization support. But I believe not using FullName might be a miss. The concept of surname and name changes quite a bit depending on local. Certain parts of Europe, Latin America, East Asia, etc don't use the standard name, surname format.
Yes, you need to override the pages, ABP cannot cover all situations, but you can customize it according to your own needs
Also is there anyway to query ExtraProperties using the default repositories? I am assuming I would have to create a MyIdentityUserRepository that inherits from IdentityUserRepository and override the GetListAsync method or Add my own GetListWithExtraAsync and include stripeId and fullName, for example.
No, you don't need it. it is already included in the entity data
//GET AN EXTRA PROPERTY var user = await _identityUserRepository.GetAsync(userId); return user.GetProperty<string>("Title");
-
0
Let me clarify my last question. I would like to query on the extra property. So for example, if I wanted to query on where fullname = "Tom" or stripeId = "123".
-
0
Hi, you can try :
var builder = Builders<IdentityUser>.Filter; var query = builder.Eq("stripeId", Value); var users = await (await userRepository.GetCollectionAsync()).Find(query).ToListAsync();
To use
GetCollectionAsync
method in the app service or domain, you need to reference the Volo.Abp.MongoDB packageMore example: https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/crud/read-operations/retrieve/#example
-
0
Thanks.