Version: 6.5.0, Asp.Net Core & Angular
Hi! Currently, I'm facing problems with the activation-code sent via e-mail being invalid (for both tenant- and user-registration). This is the case for my own project hosted in Azure as well as for the demo provided by ASPNETZERO (user-registration).
Is there something wrong with e-mail-activation?
7 Answer(s)
-
0
Hi can you share the server/client error log for your project?
Also the steps you did when activating the email on demo.aspnetzero.com ?
-
0
-
0
In database I can see the following:
After creating a new user:
- EmailConfirmationCode: [confirmation-code]
- IsActive: 0
- IsEmailConfirmed: 0
After clicking the activation-code in e-mail:
- EmailConfirmationCode: NULL
- IsActive: 0
- IsEmailConfirmed: 1
I think the problem here is that IsActive is still false. AccountAppService.ActivateEmail() does not set IsActive to true. But I'm not sure if that is on purpose.
-
0
Actually, I really think the problem is
AccountAppService.ActivateEmail()
not settingUser.IsActive
totrue
.Here's the code of current version (6.5.0) (but it is the same down to 4.5.1, which is the earliest version i have):
public async Task ActivateEmail(ActivateEmailInput input) { var user = await UserManager.GetUserByIdAsync(input.UserId); if (user == null || user.EmailConfirmationCode.IsNullOrEmpty() || user.EmailConfirmationCode != input.ConfirmationCode) { throw new UserFriendlyException(L("InvalidEmailConfirmationCode"), L("InvalidEmailConfirmationCode_Detail")); } user.IsEmailConfirmed = true; user.EmailConfirmationCode = null; await UserManager.UpdateAsync(user); }
Is there any reason to not set
User.IsActive
totrue
? -
0
User.IsActive
beingfalse
means the admin disabled the account.It is inappropriate for a user action to enable one's own account.
-
0
Hi @aaron!
Yes, that makes perfect sense, obviously!
Shame on me :D
-
0
But maybe it would make more sense to call it 'Disabled' on the UI !? I think that would better reflect it's purpose.