Skip to content

Commit

Permalink
fix: force users to resign-in
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck committed Dec 18, 2023
1 parent 7c0ca1c commit 798dcf3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions shared-helpers/src/AuthContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ export const AuthProvider: FunctionComponent<React.PropsWithChildren> = ({ child
})
if (response) {
dispatch(saveToken({ accessToken: response.accessToken, apiUrl, dispatch }))
const profile = await userService?.userControllerProfile()
if (profile) {
dispatch(saveProfile(profile))
return profile
}
// 12/18 - Short-term error fix to allow user accesss
// const profile = await userService?.userControllerProfile()
// if (profile) {
// dispatch(saveProfile(profile))
// return profile
// }
}
return undefined
} finally {
Expand Down
6 changes: 3 additions & 3 deletions sites/partners/src/pages/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const ResetPassword = () => {
const { password, passwordConfirmation } = data

try {
const user = await resetPassword(token.toString(), password, passwordConfirmation)
setSiteAlertMessage(t(`authentication.signIn.success`, { name: user.firstName }), "success")
await router.push("/")
await resetPassword(token.toString(), password, passwordConfirmation)
setSiteAlertMessage(t(`account.settings.passwordSuccess`), "notice")
await router.push("/sign-in")
window.scrollTo(0, 0)
} catch (err) {
const { status, data } = err.response || {}
Expand Down
6 changes: 3 additions & 3 deletions sites/public/src/pages/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const ResetPassword = () => {
const { password, passwordConfirmation } = data

try {
const user = await resetPassword(token.toString(), password, passwordConfirmation)
setSiteAlertMessage(t(`authentication.signIn.success`, { name: user.firstName }), "success")
await router.push("/account/dashboard")
await resetPassword(token.toString(), password, passwordConfirmation)
setSiteAlertMessage(t(`account.settings.passwordSuccess`), "notice")
await router.push("/sign-in")
} catch (err) {
const { status, data } = err.response || {}
if (status === 400) {
Expand Down

0 comments on commit 798dcf3

Please sign in to comment.