mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-24 20:43:59 +00:00
Increase length limit for email token generation
The current limit of 19 is an artifact of the implementation, which can be easily rewritten in terms of a more general string generation function. The new limit is 255 (max value of a `u8`); using a larger type would probably be overkill.
This commit is contained in:
parent
9a60eb04c2
commit
7d552dbdc8
5 changed files with 15 additions and 43 deletions
|
@ -381,7 +381,7 @@ fn post_email_token(data: JsonUpcase<EmailTokenData>, headers: Headers, conn: Db
|
|||
err!("Email domain not allowed");
|
||||
}
|
||||
|
||||
let token = crypto::generate_token(6)?;
|
||||
let token = crypto::generate_email_token(6);
|
||||
|
||||
if CONFIG.mail_enabled() {
|
||||
if let Err(e) = mail::send_change_email(&data.NewEmail, &token) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue