File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,21 @@ import { createServerRunner } from '@aws-amplify/adapter-nextjs';
77import { fetchAuthSession } from 'aws-amplify/auth/server' ;
88import { FetchAuthSessionOptions , JWT } from 'aws-amplify/auth' ;
99import { jwtDecode } from 'jwt-decode' ;
10+ import { Schema } from '../../../amplify/data/resource' ;
11+ import { generateServerClientUsingCookies } from '@aws-amplify/adapter-nextjs/data' ;
1012
1113const config = require ( '@/amplify_outputs.json' ) ;
1214
15+ export const getAmplifyBackendClient = ( ) =>
16+ generateServerClientUsingCookies < Schema > ( {
17+ config,
18+ cookies,
19+ authMode : 'iam' ,
20+ } ) ;
21+
22+ export const getSessionClient = ( ) =>
23+ getAmplifyBackendClient ( ) . models . SessionStorage ;
24+
1325export const { runWithAmplifyServerContext } = createServerRunner ( {
1426 config,
1527} ) ;
You can’t perform that action at this time.
0 commit comments