Approve User

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

After a user has been registered I am sending the following:

http://MyDoman.Com/Account/Approve/...f2af8153?Key=C3EA110078422FF19478A8B45A7C34F4

Basically, the guid after Activate/ is the user ProviderUserKey. The
key is a Hashed MD5 string created from:

String.Concat(user.UserName, user.Email, user.CreationDate.ToString())

Then I approve the user as follows:

string test = CryptographyHelper.Hash(String.Concat
(user.UserName, user.Email, user.CreationDate.ToString()));
if (key == test) {
user.IsApproved = true;
}

But shouldn't I make this URL t active the account to have a duration?
For example, after 2 weeks would be inactive ...

.... or if it would be already used then it has no effect.

Could someone, adivce me, what else should I do on my Approve method?

Thanks,

Miguel
 
Hello,

After a user has been registered I am sending the following:

http://MyDoman.Com/Account/Approve/3620e45b-d899-4990-8ea5-74cbf2af81...

Basically, the guid after Activate/ is the user ProviderUserKey. The
key is a Hashed MD5 string created from:

String.Concat(user.UserName, user.Email, user.CreationDate.ToString())

Then I approve the user as follows:

      string test = CryptographyHelper.Hash(String.Concat
(user.UserName, user.Email, user.CreationDate.ToString()));
      if (key == test) {
        user.IsApproved = true;
      }

But shouldn't I make this URL t active the account to have a duration?
For example, after 2 weeks would be inactive ...

if (key == test && DateTime.Compare(user.CreationDate.AddDays(14),
DateTime.Now) < 0) {
....
 
Back
Top