GiessC / sweep

MIT License
0 stars 0 forks source link

Cognito and JWT #37

Closed GiessC closed 7 months ago

GiessC commented 8 months ago

Unrelated to my most recent changes, but the infrastructure is creating two app clients for the Cognito user pool, even though we only specify one. The CDK must be automatically creating one for a reason unbeknownst to me.

GiessC commented 7 months ago

Unrelated to my most recent changes, but the infrastructure is creating two app clients for the Cognito user pool, even though we only specify one. The CDK must be automatically creating one for a reason unbeknownst to me.

Fixed

GiessC commented 7 months ago

I've implemented all changes that were requested, but as I've been testing the app, I've run into problems with detecting whether a user is authorized. On each page refresh, the user is reset to null. It may have to be stored in the AuthContext, but I don't have time to test it right now.

Since the user is set to null on each refresh, the API returns an Unauthorized response on every request and the Navbar component doesn't update the Login text to the user menu.

GiessC commented 7 months ago

I've implemented all changes that were requested, but as I've been testing the app, I've run into problems with detecting whether a user is authorized. On each page refresh, the user is reset to null. It may have to be stored in the AuthContext, but I don't have time to test it right now.

Since the user is set to null on each refresh, the API returns an Unauthorized response on every request and the Navbar component doesn't update the Login text to the user menu.

Fixed! I lied and stayed up nice and late to fix the errors. Got rid of the useAuth() hook and instead put our context value inside of our AuthProvider. Everything works again!