Skip to content

Commit 692785b

Browse files
authored
Feat/implement wallet connect (#116)
* feat: enhance authentication and user experience - Integrated Zustand for state management in authentication flow - Implemented loading states and error handling in login and protected route components - Added animated transitions for improved UI responsiveness - Refactored middleware for better route protection and user session management - Fixed all linting errors and improved type safety - Fixed TypeScript errors in server-auth and wallet-utils * refactor: improve type safety and cookie handling in authentication - Updated cookie handling to use await for asynchronous operations - Enhanced type safety in user object properties in getServerUser function - Refactored stellar network conversion functions for clarity and consistency
1 parent a94f625 commit 692785b

57 files changed

Lines changed: 6073 additions & 1311 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

STELLAR_WALLETS_KIT_IMPLEMENTATION.md

Lines changed: 456 additions & 0 deletions
Large diffs are not rendered by default.

app/auth/signin/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from 'react';
44
import { signIn, getSession } from 'next-auth/react';
5-
import { useRouter } from 'next/navigation';
5+
import { useRouter, useSearchParams } from 'next/navigation';
66
import Link from 'next/link';
77
import { Button } from '@/components/ui/button';
88
import { Input } from '@/components/ui/input';
@@ -26,7 +26,8 @@ export default function SignInPage() {
2626
const [isLoading, setIsLoading] = useState(false);
2727
const [error, setError] = useState('');
2828
const router = useRouter();
29-
29+
const searchParams = useSearchParams();
30+
const callbackUrl = searchParams.get('callbackUrl') || '/user';
3031
const handleSubmit = async (e: React.FormEvent) => {
3132
e.preventDefault();
3233
setIsLoading(true);
@@ -59,7 +60,7 @@ export default function SignInPage() {
5960
Cookies.set('accessToken', session?.user.accessToken ?? '');
6061
Cookies.set('refreshToken', session?.user.refreshToken ?? '');
6162
}
62-
router.push('/user');
63+
router.push(callbackUrl);
6364
}
6465
}
6566
} catch {

app/debug/page.tsx

Lines changed: 0 additions & 270 deletions
This file was deleted.

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function RootLayout({
2525
children: React.ReactNode;
2626
}>) {
2727
return (
28-
<html lang='en'>
28+
<html lang='en' suppressHydrationWarning>
2929
<body
3030
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
3131
>

0 commit comments

Comments
 (0)