config.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {Amplify} from '@aws-amplify/core';
  2. Amplify.configure({
  3. Auth: {
  4. // REQUIRED only for Federated Authentication - Amazon Cognito Identity Pool ID
  5. // identityPoolId: 'XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab',
  6. // REQUIRED - Amazon Cognito Region
  7. region: 'us-east-1',
  8. // OPTIONAL - Amazon Cognito Federated Identity Pool Region
  9. // Required only if it's different from Amazon Cognito Region
  10. // identityPoolRegion: 'XX-XXXX-X',
  11. // OPTIONAL - Amazon Cognito User Pool ID
  12. userPoolId: 'us-east-1_ldvDmC9Fe',
  13. // OPTIONAL - Amazon Cognito Web Client ID (26-char alphanumeric string)
  14. userPoolWebClientId: '41m82unjghlea984vjpk887qcr',
  15. // OPTIONAL - Enforce user authentication prior to accessing AWS resources or not
  16. // mandatorySignIn: false,
  17. // OPTIONAL - This is used when autoSignIn is enabled for Auth.signUp
  18. // 'code' is used for Auth.confirmSignUp, 'link' is used for email link verification
  19. // signUpVerificationMethod: 'code', // 'code' | 'link'
  20. // OPTIONAL - Configuration for cookie storage
  21. // Note: if the secure flag is set to true, then the cookie transmission requires a secure protocol
  22. cookieStorage: {
  23. domain: "localhost",
  24. path: "/",
  25. expires: 365,
  26. sameSite: "strict",
  27. secure: true,
  28. },
  29. // OPTIONAL - customized storage object
  30. // storage: MyStorage,
  31. // OPTIONAL - Manually set the authentication flow type. Default is 'USER_SRP_AUTH'
  32. authenticationFlowType: 'USER_SRP_AUTH',
  33. //
  34. // // OPTIONAL - Manually set key value pairs that can be passed to Cognito Lambda Triggers
  35. // clientMetadata: {myCustomKey: 'myCustomValue'},
  36. //
  37. // // OPTIONAL - Hosted UI configuration
  38. // oauth: {
  39. // domain: 'your_cognito_domain',
  40. // scope: ['phone', 'email', 'profile', 'openid', 'aws.cognito.signin.user.admin'],
  41. // redirectSignIn: 'http://localhost:3000/',
  42. // redirectSignOut: 'http://localhost:3000/',
  43. // responseType: 'code' // or 'token', note that REFRESH token will only be generated when the responseType is code
  44. }
  45. });