Skip to content

Commit 87a46a8

Browse files
committed
added safe check for token
1 parent 5822462 commit 87a46a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function App() {
5353
const location = useLocation()
5454
const { push } = useHistory()
5555
const didMountRef = useRef(false)
56-
const isDirectApprovalNotification = location.pathname && location.pathname.includes('approve') && location.search && location.search.includes('?token=')
56+
const isDirectApprovalNotification = location.pathname && location.pathname.includes('approve') && location.search && location.search.includes(`?token=${approvalToken}`)
5757

5858
function onlineToast(toastBody: JSX.Element, options) {
5959
if (onlineToastRef.current && toast.isActive(onlineToastRef.current)) {
@@ -129,7 +129,7 @@ export default function App() {
129129
useEffect(() => {
130130
// If not K8S_CLIENT then validateToken otherwise directly redirect
131131
if (!window._env_.K8S_CLIENT) {
132-
// Pass validation for direct email approval notification
132+
// By Passing validations for direct email approval notifications
133133
if (isDirectApprovalNotification) {
134134
redirectToDirectApprovalNotification()
135135
} else {

0 commit comments

Comments
 (0)