Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
return { Authorization: (await Auth.currentSession()).getIdToken().getJwtToken() }
}
catch (e) {
console.warn(e, "Defaulting to stored JWT in localStorage...");
// Get JWT from SAML.
return { Authorization: await asyncLocalStorage.getItem("jwt") }
}
}
Auth.configure({
region: 'us-east-1',
userPoolId: COGNITO_USER_POOL_ID,
userPoolWebClientId: COGNITO_CLIENT_ID,
mandatorySignIn: false
});
API.configure({
endpoints: [
{
name: "treehacks",
endpoint: ENDPOINT_URL,
custom_header: custom_header
}
]
});
const authScreenLabels = {
en: {
'Sign Up': 'Create new account',
'Sign Up Account': 'New member? Create a new account',
'Sign In Account': 'Sign In'
}
};
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import API from '@aws-amplify/api';
import PubSub from '@aws-amplify/PubSub';
import awsConfig from './aws-exports.js';
import Amplify from 'aws-amplify';
PubSub.configure(awsConfig);
API.configure(awsConfig);
Amplify.configure(awsConfig);
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));