Approve User

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
 
G

Guest

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) {
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,973
Members
47,530
Latest member
jameswilliam1

Latest Threads

Top