Skip to content

Commit

Permalink
add: stricter username limits
Browse files Browse the repository at this point in the history
add: better post intent
  • Loading branch information
trisuaso committed Nov 8, 2024
1 parent 0b7b500 commit 477ffeb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
15 changes: 12 additions & 3 deletions crates/authbeam/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,18 @@ impl Database {
"login",
"sign_up",
"settings",
"api",
"intents",
"circles",
"chats",
"responses",
"questions",
"comments",
"pages",
"inbox",
];

let regex = regex::RegexBuilder::new(r"[^\w_\-\.!]+$")
let regex = regex::RegexBuilder::new(r"[^\w_\-\.!]+")
.multi_line(true)
.build()
.unwrap();
Expand Down Expand Up @@ -628,8 +637,8 @@ impl Database {
}

// ...
let username = props.username.clone();
let password = props.password.clone();
let username = props.username.trim().to_string();
let password = props.password.trim().to_string();

// check captcha
if let Err(_) = props
Expand Down
2 changes: 1 addition & 1 deletion crates/rainbeam/templates/partials/components/compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div></div>
<div class="flex gap-2">
<button class="primary bold">Post</button>
<button type="button" class="bold" onclick="window.close()">
<button type="button" class="bold" onclick="window.history.back()">
Cancel
</button>
</div>
Expand Down
6 changes: 1 addition & 5 deletions crates/rainbeam/templates/timelines/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@
<div class="flex justify-between">
<div></div>
<div class="flex gap-2">
<a
href="/intents/post"
target="_blank"
class="button primary bold"
>
<a href="/intents/post" class="button primary bold">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
Expand Down

0 comments on commit 477ffeb

Please sign in to comment.