Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Keep up with the latest updates here :D

## 2025-08-24

### Fixed

- Fixed profile saving loading indefinitely on Google callback page when username already exists ([#108](https://github.com/beatcode-official/client/pull/108)).

---

## 2025-04-30

## Fixed
Expand Down
13 changes: 12 additions & 1 deletion src/routes/(auth)/login/google/callback/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import type { PageProps } from "./$types";

import { type Infer, superForm } from "sveltekit-superforms";
import { type Infer, setError, superForm } from "sveltekit-superforms";
import { type RegisterWithGoogleData, RegisterWithGoogleSchema } from "$models/auth";

import * as Card from "$components/ui/card";
Expand All @@ -28,7 +28,18 @@
onResult: async ({ result }) => {
if (result.type === "redirect") {
announce(result, "Account created successfully");
} else if (result.type === "error") {
isSubmitting = false;
} else if (result.type === "failure") {
const error = result.data.error;
if (error && error.toLowerCase().includes("username")) {
setError(registerForm, "username", error);
}
isSubmitting = false;
}
},
onError: () => {
isSubmitting = false;
}
});
}
Expand Down