File tree Expand file tree Collapse file tree 5 files changed +25
-13
lines changed Expand file tree Collapse file tree 5 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
3+ eslint : {
4+ // Warning: This allows production builds to successfully complete even if
5+ // your project has ESLint errors.
6+ ignoreDuringBuilds : true ,
7+ } ,
38
49 webpackDevMiddleware : ( config ) => {
510 config . watchOptions = {
Original file line number Diff line number Diff line change 1- import { FaGithub , FaGoogle } from "react-icons/fa" ;
1+ const SocialButton = ( { } ) => {
2+ return < div className = "bg-primary-foreground" > </ div > ;
3+ } ;
24
3- const SocialButton = ( { } ) => {
4- return (
5- < div className = "bg-primary-foreground" >
6- </ div >
7- )
8- }
9-
10- export default SocialButton
5+ export default SocialButton ;
Original file line number Diff line number Diff line change 1+ import { Toaster } from "@/components/ui/toaster" ;
12import { ReactNode } from "react" ;
23
34export default function AuthLayout ( { children } : { children : ReactNode } ) {
45 return (
56 < >
67 < main > { children } </ main >
8+ < Toaster />
79 </ >
810 ) ;
911}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { z } from "zod";
1515import { zodResolver } from "@hookform/resolvers/zod" ;
1616import { login } from "@/services/authService" ;
1717import { useRouter } from "next/navigation" ;
18+ import { useToast } from "@/hooks/use-toast" ;
1819
1920const FormSchema = z . object ( {
2021 email : z . string ( ) ,
@@ -24,6 +25,8 @@ const FormSchema = z.object({
2425export default function DashboardPage ( ) {
2526 const router = useRouter ( ) ;
2627
28+ const { toast } = useToast ( ) ;
29+
2730 const methods = useForm < z . infer < typeof FormSchema > > ( {
2831 resolver : zodResolver ( FormSchema ) ,
2932 } ) ;
@@ -42,12 +45,20 @@ export default function DashboardPage() {
4245 "access_token" ,
4346 accessTokenResponse . data . access_token
4447 ) ;
48+ toast ( {
49+ title : "Successfully Logged in!" ,
50+ description : "You should be redirect to /dashboard" ,
51+ } ) ;
4552 router . push ( "/dashboard" ) ;
4653 } else {
54+ toast ( {
55+ title : "Error!" ,
56+ description : accessTokenResponse . message ,
57+ } ) ;
4758 // TODO: Display error message
4859 }
4960 } ,
50- [ router ]
61+ [ router , toast ]
5162 ) ;
5263
5364 return (
Original file line number Diff line number Diff line change 55 AccessTokenPayload ,
66 AccessTokenPayloadSchema ,
77} from "@/types/Token" ;
8- import { UserProfile } from "@/types/User" ;
98import React , {
109 createContext ,
1110 useContext ,
@@ -14,11 +13,11 @@ import React, {
1413 PropsWithChildren ,
1514} from "react" ;
1615
17- const UserContext = createContext < UserProfile | undefined > ( undefined ) ;
16+ const UserContext = createContext < AccessTokenPayload | undefined > ( undefined ) ;
1817
1918export function UserProvider ( { children } : PropsWithChildren ) {
2019 // TODO: Once User Service is implemented on the backend, fetch user profile
21- const [ user , setUser ] = useState < UserProfile > ( ) ;
20+ const [ user , setUser ] = useState < AccessTokenPayload > ( ) ;
2221
2322 useEffect ( ( ) => {
2423 const token = localStorage . getItem ( "access_token" ) ;
You can’t perform that action at this time.
0 commit comments