This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +15
-23
lines changed Expand file tree Collapse file tree 5 files changed +15
-23
lines changed Original file line number Diff line number Diff line change 55 getSubscription ,
66 createClient
77} from '@/utils/supabase/server' ;
8+ import { getURL } from '@/utils/helpers' ;
89import Button from '@/components/ui/Button' ;
910import { cookies } from 'next/headers' ;
1011import Link from 'next/link' ;
@@ -54,7 +55,7 @@ export default async function Account() {
5455 ) } &error_description=${ encodeURI ( 'Your name could not be updated.' ) } `
5556 ) ;
5657 }
57- redirect (
58+ redirect (
5859 `/account?status=${ encodeURI ( 'Success!' ) } &status_description=${ encodeURI (
5960 'Your name has been updated.'
6061 ) } `
@@ -71,7 +72,7 @@ export default async function Account() {
7172 { email : newEmail } ,
7273 {
7374 emailRedirectTo :
74- process . env . NEXT_PUBLIC_SITE_URL +
75+ getURL ( ) +
7576 `/account?status=${ encodeURI (
7677 'Success!'
7778 ) } &status_description=${ encodeURI (
@@ -82,21 +83,10 @@ export default async function Account() {
8283
8384 if ( error ) {
8485 console . log ( error ) ;
85- console . log ( error . message ) ;
86- if (
87- error . message ===
88- 'A user with this email address has already been registered'
89- ) {
90- return redirect (
91- `/account?error=${ encodeURI ( 'Oops!' ) } &error_description=${ encodeURI (
92- 'It looks like that email is already in use. Please try another one.'
93- ) } `
94- ) ;
95- }
96- redirect (
97- `/account?error=${ encodeURI (
98- 'Hmm... Something went wrong.'
99- ) } &error_description=${ encodeURI ( 'Your email could not be updated.' ) } `
86+ return redirect (
87+ `/account?error=${ encodeURI ( 'Oops!' ) } &error_description=${ encodeURI (
88+ error . message
89+ ) } `
10090 ) ;
10191 }
10292 redirect (
Original file line number Diff line number Diff line change 11import SupabaseProvider from './supabase-provider' ;
22import Footer from '@/components/ui/Footer' ;
33import Navbar from '@/components/ui/Navbar' ;
4- import { Toaster } from '@/components/ui/toaster' ;
4+ import { Toaster } from '@/components/ui/Toasts/ toaster' ;
55import { PropsWithChildren } from 'react' ;
66import 'styles/main.css' ;
77
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const Toast = React.forwardRef<
4343 React . ComponentPropsWithoutRef < typeof ToastPrimitives . Root > &
4444 VariantProps < typeof toastVariants >
4545> ( ( { className, variant, ...props } , ref ) => {
46+
4647 return (
4748 < ToastPrimitives . Root
4849 ref = { ref }
Original file line number Diff line number Diff line change @@ -20,18 +20,19 @@ export function Toaster() {
2020
2121 useEffect ( ( ) => {
2222 const status = searchParams . get ( 'status' ) ;
23+ const status_description = searchParams . get ( 'status_description' ) ;
2324 const error = searchParams . get ( 'error' ) ;
24- const message = searchParams . get ( 'message ' ) ;
25+ const error_description = searchParams . get ( 'error_description ' ) ;
2526 if ( error || status ) {
2627 toast ( {
2728 title : error
2829 ? error ?? 'Hmm... Something went wrong.'
2930 : status ?? 'Alright!' ,
30- description : message ,
31+ description : error ? error_description : status_description ,
3132 variant : error ? 'destructive' : undefined
3233 } ) ;
3334 // Clear the search params so that the toast doesn't show up again on refresh
34- router . replace ( pathname , { replace : true , scroll : false } ) ;
35+ router . replace ( pathname , { scroll : false } ) ;
3536 }
3637 } , [ searchParams ] ) ;
3738
Original file line number Diff line number Diff line change 88 box-sizing : inherit;
99}
1010
11- * : focus {
11+ * : focus : not ( ol ) {
1212 @apply outline-none ring-2 ring-pink-500 ring-opacity-50;
1313}
1414
4949
5050.height-screen-helper {
5151 height : calc (100vh - 80px );
52- }
52+ }
You can’t perform that action at this time.
0 commit comments