Skip to content

Commit

Permalink
Merge pull request #400 from DishpitDev/staging
Browse files Browse the repository at this point in the history
patch invisible usernames
  • Loading branch information
Dishpit authored Jan 8, 2025
2 parents 690cde6 + 1ca63d5 commit 9f9b3db
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
Binary file added LIVE/assets/img/ngs_ver2title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion LIVE/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<header>
<h1 class="bg-red-300">Welcome to slopify.dev season 1 LIVE AND DIRECT</h1>
</header>
<a href="https://store.steampowered.com/app/1056640/Phantasy_Star_Online_2_New_Genesis/"><img src="assets/img/ngs_ver2title.png" alt="PLAY NGS!" style="width:42px;height:42px;"></a>
<hr>
<button
type="button"
Expand All @@ -63,7 +64,7 @@ <h1 class="bg-red-300">Welcome to slopify.dev season 1 LIVE AND DIRECT</h1>
</header>
<div class="center"><p>This is how to center a div!</p></div>
<hr />

<a href="https://bsky.app/profile/lillielovesick.bsky.social">Follow me :3</a>
<h3>Navigation:</h3>
<ul>
<li>
Expand Down
6 changes: 3 additions & 3 deletions Slopify/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Slopify",
"version": "0.5.0",
"version": "0.5.1",
"identifier": "com.slopify.app",
"build": {
"beforeDevCommand": "npm run dev",
Expand All @@ -12,7 +12,7 @@
"app": {
"windows": [
{
"title": "Slopify | v0.5.0",
"title": "Slopify | v0.5.1",
"minWidth": 900,
"minHeight": 800,
"center": true,
Expand All @@ -38,7 +38,7 @@
"plugins": {
"updater": {
"windows": {
"installMode": "passive"
"installMode": "basicUi"
},
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDQwNzBCNUYxNUMwQTJDNDYKUldSR0xBcGM4YlZ3UU55WnFKSU1zM3JOUHUwTE5VbnhmRFo0NzhoTzJiMXcwQ0hxOS8xdHdSSzcK",
"endpoints": [
Expand Down
9 changes: 9 additions & 0 deletions Slopify/src/components/RegisterForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export default function RegisterForm() {
.padStart(6, "0")}`;
};

const isValidDisplayName = (name) => {
return /^[a-zA-Z0-9_]+$/.test(name);
}

const handleRegister = async (e) => {
e.preventDefault();
setError("");
Expand All @@ -31,6 +35,11 @@ export default function RegisterForm() {
return;
}

if (!isValidDisplayName(displayName)) {
setError("Display name can only contain letters, numbers, and underscores.");
return;
}

try {
const { data: user, error: displayNameError } = await supabase
.from("profiles")
Expand Down
18 changes: 18 additions & 0 deletions Slopify/src/pages/ProfilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,28 @@ export default function ProfilePage() {
}
};

const isValidDisplayName = (name) => {
return /^[a-zA-Z0-9_]+$/.test(name);
}

const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);

const sanitizedDisplayName = profileData.display_name;

if (!sanitizedDisplayName.trim()) {
alert("Display name cannot be empty.");
setLoading(false);
return
}

if (!isValidDisplayName(sanitizedDisplayName)) {
alert("Display name can only contain letters, numbers, and underscores.");
setLoading(false);
return;
}

const { data: session } = await supabase.auth.getSession();
if (!session || !session.session) {
navigate("/");
Expand Down

0 comments on commit 9f9b3db

Please sign in to comment.