password changes, account name restrictions
This commit is contained in:
parent
357c38e375
commit
87bc63e648
@ -6,10 +6,13 @@
|
|||||||
* can't reset password without knowing password =\
|
* can't reset password without knowing password =\
|
||||||
* ws gzip encoding
|
* ws gzip encoding
|
||||||
|
|
||||||
* mobile info page
|
* Graphics
|
||||||
|
* Img
|
||||||
|
* Skill Icons
|
||||||
|
* Buttons / General UI Theming
|
||||||
|
* Front Page
|
||||||
|
|
||||||
## SOON
|
## SOON
|
||||||
|
|
||||||
* supporter gold name in instance (anyone whos put any money into game)
|
* supporter gold name in instance (anyone whos put any money into game)
|
||||||
|
|
||||||
* change cooldowns to delay & recharge
|
* change cooldowns to delay & recharge
|
||||||
@ -59,7 +62,7 @@
|
|||||||
* Items
|
* Items
|
||||||
* instead of red noise, red and black bar gradient
|
* instead of red noise, red and black bar gradient
|
||||||
* eth adapter
|
* eth adapter
|
||||||
*sets*
|
*sets*
|
||||||
* illusions
|
* illusions
|
||||||
* vaporwave
|
* vaporwave
|
||||||
* crop circles
|
* crop circles
|
||||||
|
|||||||
@ -2457,9 +2457,9 @@
|
|||||||
borderopacity="1.0"
|
borderopacity="1.0"
|
||||||
inkscape:pageopacity="1"
|
inkscape:pageopacity="1"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:zoom="0.53357639"
|
inkscape:zoom="0.53546627"
|
||||||
inkscape:cx="411.32817"
|
inkscape:cx="561.25984"
|
||||||
inkscape:cy="1018.5983"
|
inkscape:cy="793.70079"
|
||||||
inkscape:document-units="mm"
|
inkscape:document-units="mm"
|
||||||
inkscape:current-layer="layer1"
|
inkscape:current-layer="layer1"
|
||||||
showgrid="true"
|
showgrid="true"
|
||||||
@ -2538,17 +2538,10 @@
|
|||||||
id="layer1"
|
id="layer1"
|
||||||
transform="translate(-472.60042,755.1467)"
|
transform="translate(-472.60042,755.1467)"
|
||||||
style="display:inline">
|
style="display:inline">
|
||||||
<rect
|
|
||||||
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.01528859;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
|
||||||
id="rect5015"
|
|
||||||
width="297"
|
|
||||||
height="420"
|
|
||||||
x="472.60043"
|
|
||||||
y="-755.14679" />
|
|
||||||
<g
|
<g
|
||||||
id="g4946"
|
id="g4946"
|
||||||
style="stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none"
|
style="stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
transform="translate(0,24.99999)">
|
transform="translate(0,2.7646743)">
|
||||||
<path
|
<path
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
id="path4913"
|
id="path4913"
|
||||||
@ -2566,28 +2559,69 @@
|
|||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="g5001"
|
id="g5142"
|
||||||
transform="translate(25)">
|
transform="translate(0,-47.235375)">
|
||||||
|
<g
|
||||||
|
transform="translate(25)"
|
||||||
|
id="g5001">
|
||||||
|
<path
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
d="m 522.60042,-435.14668 v -75.00001 h 50 v 75.00001 h -50"
|
||||||
|
id="path4948"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
d="m 532.60042,-500.14669 h 30 v 55 h -30 z"
|
||||||
|
id="path4978"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
d="m 542.60042,-490.1467 h 10 v 35 h -10 v -35"
|
||||||
|
id="path4988"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
<path
|
<path
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
id="path4948"
|
id="path5003"
|
||||||
d="m 522.60042,-435.14668 v -75.00001 h 50 v 75.00001 h -50"
|
d="m 697.60042,-460.14669 -25,25.00001 -25,-25.00001 25,25.00001 v -75.00001 h -25"
|
||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:3;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
<path
|
</g>
|
||||||
inkscape:connector-curvature="0"
|
<g
|
||||||
id="path4978"
|
id="g5123"
|
||||||
d="m 532.60042,-500.14669 h 30 v 55 h -30 z"
|
transform="matrix(0.23529412,0,0,0.23529412,411.40033,-377.05346)"
|
||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
style="stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
|
||||||
<path
|
<path
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
id="path4988"
|
id="path5068"
|
||||||
d="m 542.60042,-490.1467 h 10 v 35 h -10 v -35"
|
d="m 472.60042,-185.14671 v -49.99998 h 100 v 25 h -100 l 100,24.99998"
|
||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5075"
|
||||||
|
d="m 622.60042,-185.14671 v -49.99998 h 100 v 49.99998 z"
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cccc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5082"
|
||||||
|
d="m 772.60042,-235.14669 h 99.99999 -50.00001 l 2e-5,50"
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5096"
|
||||||
|
d="m 922.60041,-185.14671 v 0 -49.99998 h 99.99999 v 49.99998 -24.99998 h -99.99999"
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5103"
|
||||||
|
d="m 1072.6004,-235.14669 h 100 -50 v 49.99998"
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccccc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5110"
|
||||||
|
d="m 1322.6004,-185.14669 -100,-2e-5 v -24.99998 h 75 -75 v -25 h 100"
|
||||||
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:12.75;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
</g>
|
</g>
|
||||||
<path
|
|
||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f5f5f5;stroke-width:2.9685142;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
|
||||||
d="m 697.60042,-460.14669 -25,25.00001 -25,-25.00001 25,25.00001 v -75.00001 h -25"
|
|
||||||
id="path5003"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 98 KiB |
@ -122,6 +122,10 @@ section {
|
|||||||
// height: 3em;
|
// height: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.sub {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
&.play {
|
&.play {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|||||||
@ -44,21 +44,26 @@ function BitsBtn(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const subscription = account.subscribed
|
const subscription = account.subscribed
|
||||||
? <button
|
? <figure>
|
||||||
class="yellow-btn"
|
<figcaption>Thank you for your support</figcaption>
|
||||||
disabled>
|
<button
|
||||||
Subscribed
|
class="yellow-btn"
|
||||||
</button>
|
disabled>
|
||||||
: <button
|
Subscribed
|
||||||
onClick={subscribeClick}
|
</button>
|
||||||
class="yellow-btn"
|
</figure>
|
||||||
role="link">
|
: <figure onClick={subscribeClick}>
|
||||||
Subscribe
|
<figcaption>¤150 / month + Chat Wheel + more</figcaption>
|
||||||
</button>;
|
<button
|
||||||
|
class="yellow-btn"
|
||||||
|
role="link">
|
||||||
|
Subscribe
|
||||||
|
</button>
|
||||||
|
</figure>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div class='list'>
|
<div class='list sub'>
|
||||||
{subscription}
|
{subscription}
|
||||||
</div>
|
</div>
|
||||||
<div class='list'>
|
<div class='list'>
|
||||||
|
|||||||
@ -22,6 +22,7 @@ use failure::Error;
|
|||||||
use failure::{err_msg, format_err};
|
use failure::{err_msg, format_err};
|
||||||
|
|
||||||
static PASSWORD_MIN_LEN: usize = 3;
|
static PASSWORD_MIN_LEN: usize = 3;
|
||||||
|
static PASSWORD_ROUNDS: u32 = 10;
|
||||||
|
|
||||||
#[derive(Debug,Clone,Serialize,Deserialize)]
|
#[derive(Debug,Clone,Serialize,Deserialize)]
|
||||||
pub struct Account {
|
pub struct Account {
|
||||||
@ -70,11 +71,11 @@ pub fn chat_wheel(_db: &Db, _id: Uuid) -> Result<Vec<String>, Error> {
|
|||||||
return Ok(vec![
|
return Ok(vec![
|
||||||
"gg".to_string(),
|
"gg".to_string(),
|
||||||
"glhf".to_string(),
|
"glhf".to_string(),
|
||||||
"hmm".to_string(),
|
"ez".to_string(),
|
||||||
"ok".to_string(),
|
|
||||||
"rekt".to_string(),
|
"rekt".to_string(),
|
||||||
"thx".to_string(),
|
|
||||||
"nice".to_string(),
|
"nice".to_string(),
|
||||||
|
"wp".to_string(),
|
||||||
|
"ok".to_string(),
|
||||||
"...".to_string(),
|
"...".to_string(),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@ -226,8 +227,7 @@ pub fn set_password(tx: &mut Transaction, id: Uuid, current: &String, password:
|
|||||||
return Err(MnmlHttpError::BadRequest);
|
return Err(MnmlHttpError::BadRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
let rounds = 8;
|
let password = hash(&password, PASSWORD_ROUNDS)?;
|
||||||
let password = hash(&password, rounds)?;
|
|
||||||
|
|
||||||
let query = "
|
let query = "
|
||||||
UPDATE accounts
|
UPDATE accounts
|
||||||
@ -327,10 +327,13 @@ pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<
|
|||||||
return Err(MnmlHttpError::AccountNameNotProvided);
|
return Err(MnmlHttpError::AccountNameNotProvided);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if name.len() > 20 {
|
||||||
|
return Err(MnmlHttpError::AccountNameUnacceptable);
|
||||||
|
}
|
||||||
|
|
||||||
let id = Uuid::new_v4();
|
let id = Uuid::new_v4();
|
||||||
let img = Uuid::new_v4();
|
let img = Uuid::new_v4();
|
||||||
let rounds = 12;
|
let password = hash(&password, PASSWORD_ROUNDS)?;
|
||||||
let password = hash(&password, rounds)?;
|
|
||||||
|
|
||||||
let mut rng = thread_rng();
|
let mut rng = thread_rng();
|
||||||
let token: String = iter::repeat(())
|
let token: String = iter::repeat(())
|
||||||
|
|||||||
@ -44,7 +44,9 @@ pub enum MnmlHttpError {
|
|||||||
AccountNameNotProvided,
|
AccountNameNotProvided,
|
||||||
#[fail(display="account name unavailable")]
|
#[fail(display="account name unavailable")]
|
||||||
AccountNameUnavailable,
|
AccountNameUnavailable,
|
||||||
#[fail(display="account not found")]
|
#[fail(display="account name unavailable")]
|
||||||
|
AccountNameUnacceptable,
|
||||||
|
#[fail(display="account name is unacceptable. 20 char max")]
|
||||||
AccountNotFound,
|
AccountNotFound,
|
||||||
#[fail(display="password does not match")]
|
#[fail(display="password does not match")]
|
||||||
PasswordNotMatch,
|
PasswordNotMatch,
|
||||||
@ -122,6 +124,7 @@ impl From<MnmlHttpError> for IronError {
|
|||||||
|
|
||||||
MnmlHttpError::AccountNameNotProvided |
|
MnmlHttpError::AccountNameNotProvided |
|
||||||
MnmlHttpError::AccountNameUnavailable |
|
MnmlHttpError::AccountNameUnavailable |
|
||||||
|
MnmlHttpError::AccountNameUnacceptable |
|
||||||
MnmlHttpError::AccountNotFound |
|
MnmlHttpError::AccountNotFound |
|
||||||
MnmlHttpError::BadRequest |
|
MnmlHttpError::BadRequest |
|
||||||
MnmlHttpError::PasswordUnacceptable => (m_err.compat(), status::BadRequest),
|
MnmlHttpError::PasswordUnacceptable => (m_err.compat(), status::BadRequest),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user