Skip to content

Commit 35c048e

Browse files
committed
fix dashboard redirect
1 parent be8f57b commit 35c048e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pages/my-dashboard.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { getServerSession } from 'next-auth/next'
2222
import { acronym } from '../lib/acronym'
2323
import ErrorPage from '../components/ErrorPage'
2424
import { GetServerSidePropsContext } from 'next'
25+
import querystring from 'querystring'
2526

2627
interface MyDashboardProps {
2728
locale: string
@@ -154,13 +155,10 @@ export async function getServerSideProps({
154155
query: GetServerSidePropsContext['query']
155156
}) {
156157
const session = await getServerSession(req, res, authOptions)
157-
const { endpoint } = query
158+
const { link } = query
158159

159160
// special handling for redirects from ecas
160-
const params = new URLSearchParams()
161-
if (endpoint) {
162-
params.append('endpoint', endpoint.toString())
163-
}
161+
const params = link ? querystring.stringify(query) : ''
164162

165163
if (!AuthIsDisabled() && !(await AuthIsValid(req, session)))
166164
return {

0 commit comments

Comments
 (0)