Skip to content

Commit

Permalink
chore: move files from pages api to app api
Browse files Browse the repository at this point in the history
move files 2

move files 3
  • Loading branch information
rmonnier9 committed Oct 14, 2024
1 parent 76c9b74 commit 45685e4
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 2 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import { agentConnectAuthorizeUrl } from '#clients/authentication/agent-connect/
import { logFatalErrorInSentry } from '#utils/sentry';
import { setPathFrom } from '#utils/session';
import withSession from '#utils/session/with-session';
import { AgentConnectionFailedException } from './callback';
import { AgentConnectionFailedException } from '../../../../pages/api/auth/agent-connect/callback';

export default withSession(async function loginRoute(req, res) {
try {
// Get the pathFrom from query params or headers
const pathFrom =
(req?.query?.pathFrom as string) || req.headers.referer || '';
req.nextUrl.searchParams.get('pathFrom') ||
req.headers.get('referer') ||
'';

await setPathFrom(req.session, pathFrom);
const url = await agentConnectAuthorizeUrl(req);
res.redirect(url);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 45685e4

Please sign in to comment.