Kaufabschluss funktioniert.
Kaufabschluss funktioniert einzeln, gesamter Durchgang geht auch. Input Validation ist der nächste große Schritt. Im Formular kommen immer noch viele Werte raus die wir nicht in der Datenbank haban wollen...
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
|
||||
import cookies from 'js-cookie';
|
||||
import type { AppRouter } from '@ibcornelsen/api';
|
||||
import { Buffer } from 'buffer';
|
||||
|
||||
export const client = createTRPCProxyClient<AppRouter>({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: 'http://localhost:3001/',
|
||||
headers() {
|
||||
const accessToken = cookies.get('accessToken');
|
||||
if (!accessToken) return {};
|
||||
|
||||
const buffer = Buffer.from(accessToken, 'utf-8');
|
||||
const base64 = buffer.toString('base64')
|
||||
|
||||
return {
|
||||
'Authorization': `Bearer ${cookies.get('accessToken')}`,
|
||||
'Authorization': `Bearer ${base64}`,
|
||||
};
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user