Skip to content

Commit

Permalink
fix: adds InternalAuth to requiredModules for SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
erinleigh90 committed Aug 18, 2023
1 parent b6987fc commit 2dcd389
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/aws-amplify/src/withSSRContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import { DataStore } from '@aws-amplify/datastore';
import { Amplify } from './index';

const requiredModules = [
// API cannot function without Auth
// Credentials cannot function without Auth
Auth,
// API cannot function without InternalAuth
InternalAuth,
// Auth cannot function without Credentials
Credentials,
];
Expand All @@ -29,8 +31,8 @@ export function withSSRContext(context: Context = {}) {
const { modules = defaultModules, req } = context;
if (modules.includes(DataStore)) {
modules.push(InternalAPI);
modules.push(InternalAuth);
}

const previousConfig = Amplify.configure();
const amplify = new AmplifyClass();
const storage = new UniversalStorage({ req });
Expand Down

0 comments on commit 2dcd389

Please sign in to comment.