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, id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
email VARCHAR NOT NULL, email VARCHAR NOT NULL,
password VARCHAR NOT NULL, password VARCHAR NOT NULL,
pw_cost VARCHAR NOT NULL, pw_cost INTEGER NOT NULL,
pw_nonce VARCHAR NOT NULL, pw_nonce VARCHAR NOT NULL,
version 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)] #[derive(Serialize)]
struct AuthParams { struct AuthParams {
pw_cost: String, pw_cost: i32,
pw_nonce: String, pw_nonce: String,
version: String version: String
} }

View file

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

View file

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