Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Fixed cred externalization issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjun SK committed Apr 21, 2020
1 parent 592c890 commit 52de6df
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
22 changes: 22 additions & 0 deletions src/aws-exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const awsmobile = {
"aws_project_region": "ap-northeast-1",
"aws_cognito_region": "ap-northeast-1",
"aws_user_pools_id": "<cognito-user-pool-id>",
"aws_user_pools_web_client_id": "<client-id>",
"oauth": {
"domain": "domain.auth.ap-northeast-1.amazoncognito.com",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "http://localhost:4200/login",
"redirectSignOut": "http://localhost:4200/login",
"responseType": "code"
}
};


export default awsmobile;
19 changes: 2 additions & 17 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,10 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import awsconfig from './aws-exports';
import Amplify from 'aws-amplify';

Amplify.configure({
Auth: {
region: '<region>',
userPoolId: '<userpool-id>',
userPoolWebClientId: '<client-id>',
oauth: {
domain: '<domain>.auth.eu-west-1.amazoncognito.com',
scope: ['phone', 'email', 'profile', 'openid', 'aws.cognito.signin.user.admin'],
redirectSignIn: 'https://<cloudfront>/login',
redirectSignOut: 'https://<cloudfront>/login',
responseType: 'code',
options: {
AdvancedSecurityDataCollectionFlag: true
}
}
}
});
Amplify.configure(awsconfig);

if (environment.production) {
enableProdMode();
Expand Down

0 comments on commit 52de6df

Please sign in to comment.