コード例 #1
0
 public Invite CreateInvite(AuthenticationAccount account, ConfirmationType type)
 => new Invite
 {
     Id               = Guid.NewGuid(),
     Type             = type,
     Email            = account.ServiceId,
     ConfirmationCode = dataGenerator.GenerateSequence(FieldsLength.ConfirmationCode),
     IsUsed           = false,
     AccountId        = account.Id,
     PasswordRestore  = false,
 };
コード例 #2
0
        public PasswordToken CreatePasswordToken(string userPassword)
        {
            var salt = dataGenerator.GenerateSequence(FieldsLength.Salt);
            var hash = GetHash(userPassword, salt);

            return(new PasswordToken {
                Salt = salt, Base64Hash = hash.ToBase64()
            });
        }