Skip to content

Commit

Permalink
Fix: update user check logic in Activate and ResetPassword pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Feb 4, 2025
1 parent b7c8140 commit 7c56669
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion backend/src/pages/Activate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ const Activate = () => {
}

const onLoad = async (user?: bookcarsTypes.User) => {
if (!user) {
if (user) {
setNoMatch(true)
} else {
const params = new URLSearchParams(window.location.search)
if (params.has('u') && params.has('e') && params.has('t')) {
const _userId = params.get('u')
Expand Down
4 changes: 3 additions & 1 deletion backend/src/pages/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ const ResetPassword = () => {
}

const onLoad = async (user?: bookcarsTypes.User) => {
if (!user) {
if (user) {
setNoMatch(true)
} else {
const params = new URLSearchParams(window.location.search)
if (params.has('u') && params.has('e') && params.has('t')) {
const _userId = params.get('u')
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/Activate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ const Activate = () => {
}

const onLoad = async (user?: bookcarsTypes.User) => {
if (!user) {
if (user) {
setNoMatch(true)
} else {
const params = new URLSearchParams(window.location.search)
if (params.has('u') && params.has('e') && params.has('t')) {
const _userId = params.get('u')
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const ResetPassword = () => {
}

const onLoad = async (user?: bookcarsTypes.User) => {
if (!user) {
if (user) {
setNoMatch(true)
} else {
const params = new URLSearchParams(window.location.search)
if (params.has('u') && params.has('e') && params.has('t')) {
const _userId = params.get('u')
Expand Down

0 comments on commit 7c56669

Please sign in to comment.