Cleaning
This commit is contained in:
24
Account.cs
24
Account.cs
@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using MySql.Data.MySqlClient;
|
using MySql.Data.MySqlClient;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace NightmareCoreWeb2
|
namespace NightmareCoreWeb2
|
||||||
{
|
{
|
||||||
@ -125,25 +123,6 @@ namespace NightmareCoreWeb2
|
|||||||
|
|
||||||
conn.Close();
|
conn.Close();
|
||||||
}
|
}
|
||||||
public bool AuthenticateWithToken(string token)
|
|
||||||
{
|
|
||||||
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
|
||||||
conn.Open();
|
|
||||||
string sql = "select token from tokens.active_tokens where email=@email";
|
|
||||||
MySqlCommand cmd = new MySqlCommand(sql, conn);
|
|
||||||
cmd.Parameters.AddWithValue("email", this.Email);
|
|
||||||
MySqlDataReader rdr = cmd.ExecuteReader();
|
|
||||||
string dbToken = "";
|
|
||||||
while (rdr.Read())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dbToken = rdr.GetString(0);
|
|
||||||
}
|
|
||||||
catch (Exception) { }
|
|
||||||
}
|
|
||||||
return token.Equals(dbToken);
|
|
||||||
}
|
|
||||||
public bool AuthenticateAccount(string password)
|
public bool AuthenticateAccount(string password)
|
||||||
{
|
{
|
||||||
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
||||||
@ -170,7 +149,8 @@ namespace NightmareCoreWeb2
|
|||||||
{
|
{
|
||||||
return verifier.Compare(this.Verifier);
|
return verifier.Compare(this.Verifier);
|
||||||
}
|
}
|
||||||
public void ChangePassword(string NewPassword) {
|
public void ChangePassword(string NewPassword)
|
||||||
|
{
|
||||||
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
MySqlConnection conn = new MySqlConnection(Program.connStr);
|
||||||
conn.Open();
|
conn.Open();
|
||||||
byte[] salt = new byte[32];
|
byte[] salt = new byte[32];
|
||||||
|
|||||||
Reference in New Issue
Block a user