change pw_cost to integer to match official impl

This commit is contained in:
Peter Cai 2020-02-21 15:19:59 +08:00
parent 783873b74d
commit 6729959580
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
4 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
email VARCHAR NOT NULL,
password VARCHAR NOT NULL,
pw_cost VARCHAR NOT NULL,
pw_cost INTEGER NOT NULL,
pw_nonce VARCHAR NOT NULL,
version VARCHAR NOT NULL
)

View File

@ -81,7 +81,7 @@ fn _sign_in(db: DbConn, mail: &str, passwd: &str) -> Custom<JsonResp<AuthResult>
#[derive(Serialize)]
struct AuthParams {
pw_cost: String,
pw_cost: i32,
pw_nonce: String,
version: String
}

View File

@ -17,7 +17,7 @@ table! {
id -> Integer,
email -> Text,
password -> Text,
pw_cost -> Text,
pw_cost -> Integer,
pw_nonce -> Text,
version -> Text,
}

View File

@ -66,7 +66,7 @@ struct UserQuery {
pub id: i32,
pub email: String,
pub password: String,
pub pw_cost: String,
pub pw_cost: i32,
pub pw_nonce: String,
pub version: String
}
@ -91,7 +91,7 @@ pub struct User {
pub id: i32,
pub email: String,
pub password: Password,
pub pw_cost: String,
pub pw_cost: i32,
pub pw_nonce: String,
pub version: String
}
@ -101,7 +101,7 @@ pub struct User {
pub struct NewUser {
pub email: String,
pub password: String,
pub pw_cost: String,
pub pw_cost: i32,
pub pw_nonce: String,
pub version: String
}