Skip to content

Commit

Permalink
Fix amplify erroring when attempting to login (#139842)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsummers1 authored Nov 25, 2024
1 parent 21ebf38 commit fbc2985
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 323 deletions.
1 change: 0 additions & 1 deletion services/app-api/handlers/uploads/tests/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe("Test Delete Upload Handler", () => {
test("Should Call S3 delete when entry exists", async () => {
const event: APIGatewayProxyEvent = {
...testEvent,
body: `{"fileId": "uniqueIdString"}`,
pathParameters: { year: "2022", state: "AL", fileId: "uniqueIdString" },
};

Expand Down
2 changes: 1 addition & 1 deletion services/app-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ functions:
handler: handlers/uploads/delete.deleteUpload
events:
- http:
path: uploads/{year}/{state}
path: uploads/{year}/{state}/{fileId}
method: delete
cors: true
authorizer: aws_iam
Expand Down
3 changes: 1 addition & 2 deletions services/ui-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@aws-amplify/rtn-web-browser": "^1.0.28",
"@cmsgov/design-system": "^3.8.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
Expand All @@ -16,7 +15,7 @@
"@testing-library/user-event": "^14.5.1",
"@vitejs/plugin-react": "^4.2.1",
"aws-amplify": "^6.6.4",
"date-fns": "^3.6.0",
"date-fns": "^4.1.0",
"font-awesome": "^4.7.0",
"jsonpath": "^1.1.1",
"launchdarkly-react-client-sdk": "^3.6.0",
Expand Down
17 changes: 6 additions & 11 deletions services/ui-src/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import store from "./store/storeIndex";
import BrowserIssue from "./components/layout/BrowserIssue";
import App from "./App";
import { Amplify } from "aws-amplify";
import "aws-amplify/auth/enable-oauth-listener";
import config from "./config";
import { asyncWithLDProvider } from "launchdarkly-react-client-sdk";

Expand All @@ -18,9 +19,10 @@ const isEdge = !isIE && !!window.StyleMedia;

Amplify.configure({
Storage: {
region: config.s3.REGION,
bucket: config.s3.BUCKET,
identityPoolId: config.cognito.IDENTITY_POOL_ID,
S3: {
region: config.s3.REGION,
bucket: config.s3.BUCKET,
},
},
API: {
REST: {
Expand All @@ -32,8 +34,6 @@ Amplify.configure({
},
Auth: {
Cognito: {
mandatorySignIn: true,
region: config.cognito.REGION,
userPoolId: config.cognito.USER_POOL_ID,
identityPoolId: config.cognito.IDENTITY_POOL_ID,
userPoolClientId: config.cognito.APP_CLIENT_ID,
Expand All @@ -42,12 +42,7 @@ Amplify.configure({
domain: config.cognito.APP_CLIENT_DOMAIN,
redirectSignIn: [config.cognito.REDIRECT_SIGNIN],
redirectSignOut: [config.cognito.REDIRECT_SIGNOUT],
scopes: [
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin",
],
scopes: ["email", "openid", "profile"],
responseType: "code",
},
},
Expand Down
2 changes: 0 additions & 2 deletions services/ui-src/src/store/saveMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const saveMiddleware = (store) => {
opts.body = store.getState().formData;
// get the state and year from basic state info section
const { stateId, year } = opts.body[0];

await apiLib.put(`/save_report/${year}/${stateId}`, opts);

/*
* If the save is successful, we can clear out the list of pending
* saves, because they have been persisted on the server.
Expand Down
Loading

0 comments on commit fbc2985

Please sign in to comment.