forked from jmug/stoatchat
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de5428348c | ||
|
|
d7527d9131 | ||
|
|
c59c4146c4 | ||
|
|
bd455b59fb |
No files matched your search
Generated
+1
-1
@@ -2999,7 +2999,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "revolt-quark"
|
name = "revolt-quark"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/revoltchat/quark?rev=e0ac2fe6c1ed4c874bb39cdd119958ee7f8d0c02#e0ac2fe6c1ed4c874bb39cdd119958ee7f8d0c02"
|
source = "git+https://github.com/revoltchat/quark?rev=45706b93d4da11cf3e0f3ca41514c73945bb348d#45706b93d4da11cf3e0f3ca41514c73945bb348d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"async-std",
|
"async-std",
|
||||||
|
|||||||
+1
-1
@@ -64,5 +64,5 @@ schemars = "0.8.8"
|
|||||||
rocket_okapi = { git = "https://github.com/insertish/okapi", rev = "dcf0df115596ee07a587a7a543cddf3d7944645b", features = [ "swagger" ] }
|
rocket_okapi = { git = "https://github.com/insertish/okapi", rev = "dcf0df115596ee07a587a7a543cddf3d7944645b", features = [ "swagger" ] }
|
||||||
|
|
||||||
# quark
|
# quark
|
||||||
revolt-quark = { git = "https://github.com/revoltchat/quark", rev = "e0ac2fe6c1ed4c874bb39cdd119958ee7f8d0c02" }
|
revolt-quark = { git = "https://github.com/revoltchat/quark", rev = "45706b93d4da11cf3e0f3ca41514c73945bb348d" }
|
||||||
# revolt-quark = { path = "../quark" }
|
# revolt-quark = { path = "../quark" }
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export version=0.5.3
|
export version=0.5.3-2
|
||||||
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
||||||
@@ -45,7 +45,7 @@ pub async fn create_bot(db: &Db, user: User, info: Json<DataCreateBot>) -> Resul
|
|||||||
let id = Ulid::new().to_string();
|
let id = Ulid::new().to_string();
|
||||||
let bot_user = User {
|
let bot_user = User {
|
||||||
id: id.clone(),
|
id: id.clone(),
|
||||||
username: info.name,
|
username: info.name.trim().to_string(),
|
||||||
bot: Some(BotInformation {
|
bot: Some(BotInformation {
|
||||||
owner: user.id.clone(),
|
owner: user.id.clone(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ pub async fn req(
|
|||||||
data: Json<DataChangeUsername>,
|
data: Json<DataChangeUsername>,
|
||||||
) -> Result<Json<User>> {
|
) -> Result<Json<User>> {
|
||||||
let data = data.into_inner();
|
let data = data.into_inner();
|
||||||
|
data.validate()
|
||||||
|
.map_err(|error| Error::FailedValidation { error })?;
|
||||||
|
|
||||||
account
|
account
|
||||||
.verify_password(&data.password)
|
.verify_password(&data.password)
|
||||||
.map_err(|_| Error::InvalidCredentials)?;
|
.map_err(|_| Error::InvalidCredentials)?;
|
||||||
|
|||||||
+6
-1
@@ -1,4 +1,9 @@
|
|||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
pub static RE_USERNAME: Lazy<Regex> = Lazy::new(|| Regex::new(r"^[a-zA-Z0-9_.]+$").unwrap());
|
/// Regex for valid usernames
|
||||||
|
///
|
||||||
|
/// Block zero width space
|
||||||
|
/// Block lookalike characters
|
||||||
|
pub static RE_USERNAME: Lazy<Regex> =
|
||||||
|
Lazy::new(|| Regex::new(r"^[^\u200BА-Яа-яΑ-Ωα-ω]+$").unwrap());
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
pub const VERSION: &str = "0.5.3";
|
pub const VERSION: &str = "0.5.3-2";
|
||||||
Reference in new issue
Block a user