Skip to content
Merged
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
17 changes: 5 additions & 12 deletions src/routes/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,11 @@ function Login() {
<button
type="button"
className="w-full rounded-[10px] border border-input bg-background p-3 font-medium text-foreground transition-all hover:bg-accent hover:text-accent-foreground hover:border-ring flex items-center justify-center gap-2"
onClick={async () => {
try {
await authClient.signIn.social({
provider: 'google',
callbackURL: window.location.origin + '/dashboard',
})
} catch (err: any) {
console.error('Google Signin Error:', err)
alert(
'Google Signin Failed: ' + (err.message || JSON.stringify(err)),
)
}
onClick={() => {
// Redirect to backend OAuth endpoint directly
const backendUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000';
const callbackUrl = encodeURIComponent(window.location.origin + '/dashboard');
window.location.href = `${backendUrl}/api/auth/sign-in/social?provider=google&callbackURL=${callbackUrl}`;
}}
>
<svg className="h-5 w-5" viewBox="0 0 24 24">
Expand Down
17 changes: 5 additions & 12 deletions src/routes/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,11 @@ function Signup() {
<button
type="button"
className="w-full rounded-[10px] border border-input bg-background p-3 font-medium text-foreground transition-all hover:bg-accent hover:text-accent-foreground hover:border-ring flex items-center justify-center gap-2"
onClick={async () => {
try {
await authClient.signIn.social({
provider: 'google',
callbackURL: window.location.origin + '/dashboard',
})
} catch (err: any) {
console.error('Google Signin Error:', err)
alert(
'Google Signin Failed: ' + (err.message || JSON.stringify(err)),
)
}
onClick={() => {
// Redirect to backend OAuth endpoint directly
const backendUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000';
const callbackUrl = encodeURIComponent(window.location.origin + '/dashboard');
window.location.href = `${backendUrl}/api/auth/sign-in/social?provider=google&callbackURL=${callbackUrl}`;
}}
>
<svg className="h-5 w-5" viewBox="0 0 24 24">
Expand Down