Skip to content

Commit

Permalink
AH should not get manage clients option and logout redirection fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijesh committed Feb 12, 2024
1 parent 79501bf commit 664f163
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
15 changes: 11 additions & 4 deletions src/components/ReturnPage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import {parseQuery, getTokenFromSSO, saveAuthDataInLocal, getDataFromLocalStorage} from '../utils'
import {
parseQuery,
getTokenFromSSO,
saveAuthDataInLocal,
getDataFromLocalStorage
} from '../utils'
import { SSO_LOGOUT_ENDPOINT } from '../constants/api'
import { REDIRECTING } from '../constants/strings'
import {LOCAL_STORAGE_KEY, RETURN_PAGE_TYPE} from '../constants/variables'
import { LOCAL_STORAGE_KEY, RETURN_PAGE_TYPE } from '../constants/variables'

class ReturnPage extends Component {
static propTypes = {
Expand All @@ -18,7 +23,9 @@ class ReturnPage extends Component {
switch (type) {
case RETURN_PAGE_TYPE.LOGIN:
if (code) {
const { codeVerifier, codeVerifierHash } = getDataFromLocalStorage(LOCAL_STORAGE_KEY.AUTH_PKCE_CODE);
const { codeVerifier, codeVerifierHash } = getDataFromLocalStorage(
LOCAL_STORAGE_KEY.AUTH_PKCE_CODE
)
if (!codeVerifier || !codeVerifierHash) {
// we cannot proceed without the pkce challenge code
window.close()
Expand All @@ -36,7 +43,7 @@ class ReturnPage extends Component {
break
case RETURN_PAGE_TYPE.LOGOUT:
// finished logging out, close this page
window.close()
window.location = '/'
break
default:
break
Expand Down
22 changes: 14 additions & 8 deletions src/components/mainPage/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { Dropdown, Icon } from 'semantic-ui-react'
import { Avatar } from '../common'
import * as Routes from '../../constants/routes'
import { IMAGE_SRC, ELEMENT_ID } from '../../constants/variables'
import { isUserAdmin, signOutFromSSOAndSiteMinder } from '../../utils'
import {
isUserAdmin,
isUserAgreementHolder,
signOutFromSSOAndSiteMinder
} from '../../utils'
import { signOut } from '../../actionCreators'
import {
SELECT_RUP,
Expand Down Expand Up @@ -65,13 +69,15 @@ export class Navbar extends Component {
<div className="navbar__link__underline" />
</NavLink>
*/}
<NavLink
to={Routes.MANAGE_CLIENT}
className="navbar__link"
activeClassName="navbar__link--active">
{MANAGE_CLIENTS}
<div className="navbar__link__underline" />
</NavLink>
{!isUserAgreementHolder(user) && (
<NavLink
to={Routes.MANAGE_CLIENT}
className="navbar__link"
activeClassName="navbar__link--active">
{MANAGE_CLIENTS}
<div className="navbar__link__underline" />
</NavLink>
)}
<NavLink
to={Routes.MERGE_ACCOUNT}
className="navbar__link"
Expand Down

0 comments on commit 664f163

Please sign in to comment.