Skip to content

Commit

Permalink
Revert "Feature: Fix selfcare token not removing from hash and wrong …
Browse files Browse the repository at this point in the history
…redirect on e-service version selection (#607)" (#608)

This reverts commit 2b850c0.
  • Loading branch information
ruggerocastagnola committed Oct 23, 2023
1 parent 803d587 commit b7a0da5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api/auth/auth.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function getSessionToken(): Promise<string | null> {
if (hasSelfCareIdentityToken) {
const selfCareIdentityToken = window.location.hash.replace('#id=', '')
// Remove token from hash
location.hash = ''
history.replaceState({}, document.title, window.location.href.split('#')[0])
try {
const result = await swapTokens(selfCareIdentityToken)
return resolveToken(result.session_token)
Expand Down
8 changes: 2 additions & 6 deletions src/components/shared/EServiceVersionSelectorDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
import { Drawer } from '@/components/shared/Drawer'
import { Slider, Typography } from '@mui/material'
import type { Mark } from '@mui/base'
import { type RouteKey, useCurrentRoute, useNavigate } from '@/router'
import { useNavigate } from '@/router'
import { useTranslation } from 'react-i18next'

type EServiceVersionSelectorDrawerProps = {
Expand All @@ -21,7 +21,6 @@ export const EServiceVersionSelectorDrawer: React.FC<EServiceVersionSelectorDraw
descriptor,
}) => {
const { t } = useTranslation('eservice', { keyPrefix: 'read.drawers.versionSelectorDrawer' })
const { mode } = useCurrentRoute()

const [selectedVersion, setSelectedVersion] = React.useState(() => Number(descriptor.version))
const navigate = useNavigate()
Expand Down Expand Up @@ -54,10 +53,7 @@ export const EServiceVersionSelectorDrawer: React.FC<EServiceVersionSelectorDraw
)

if (selectedDescriptor) {
const routeKey: RouteKey =
mode === 'provider' ? 'PROVIDE_ESERVICE_MANAGE' : 'SUBSCRIBE_CATALOG_VIEW'

navigate(routeKey, {
navigate('SUBSCRIBE_CATALOG_VIEW', {
params: { eserviceId: descriptor.eservice.id, descriptorId: selectedDescriptor.id },
})
}
Expand Down

0 comments on commit b7a0da5

Please sign in to comment.