File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,7 @@ import { toast } from 'sonner';
14
14
import { useRouter } from 'next/navigation' ;
15
15
import { setAuthCode } from './utils' ;
16
16
17
- const NEXT_PUBLIC_SERVER_ORIGIN_URL = process . env . NEXT_PUBLIC_SERVER_ORIGIN_URL ;
18
-
19
- if (
20
- NEXT_PUBLIC_SERVER_ORIGIN_URL === undefined ||
21
- NEXT_PUBLIC_SERVER_ORIGIN_URL === ''
22
- ) {
23
- throw new Error ( 'app-err: NEXT_PUBLIC_SERVER_ORIGIN_URL is not defined!' ) ;
24
- }
17
+ const serverOriginUrl = process . env . NEXT_PUBLIC_SERVER_ORIGIN_URL ;
25
18
26
19
export function isTRPCClientError (
27
20
cause : unknown ,
@@ -98,7 +91,7 @@ export const TrpcProvider: React.FC<{ children: React.ReactNode }> = ({
98
91
enabled : ( ) => true ,
99
92
} ) ,
100
93
httpBatchLink ( {
101
- url : NEXT_PUBLIC_SERVER_ORIGIN_URL + '/trpc' ,
94
+ url : serverOriginUrl + '/trpc' ,
102
95
async headers ( ) {
103
96
const token = localStorage . getItem ( 'authCode' ) || '' ;
104
97
You can’t perform that action at this time.
0 commit comments