diff --git a/striker-ui-api/src/lib/assertAuthentication.ts b/striker-ui-api/src/lib/assertAuthentication.ts index e1a268f2..443dad37 100644 --- a/striker-ui-api/src/lib/assertAuthentication.ts +++ b/striker-ui-api/src/lib/assertAuthentication.ts @@ -29,7 +29,7 @@ export const assertAuthentication: AssertAuthenticationFunction = ({ let getReturnTo: ((...args: HandlerParameters) => string) | undefined; if (failReturnTo === true) { - getReturnTo = ({ path }) => path; + getReturnTo = ({ originalUrl, url }) => originalUrl || url; } else if (typeof failReturnTo === 'string') { getReturnTo = () => failReturnTo; } @@ -47,14 +47,14 @@ export const assertAuthentication: AssertAuthenticationFunction = ({ return (...args) => { const { 0: request } = args; - const { path, session } = request; + const { originalUrl, session } = request; const { passport } = session; if (passport?.user) return succeed(...args); const rt = getReturnTo?.call(null, ...args); - stdout(`Unauthenticated access to ${path}`); + stdout(`Unauthenticated access to ${originalUrl}`); if (rt) { stdout(`Set session.returnTo=${rt}`); diff --git a/striker-ui-api/src/session.ts b/striker-ui-api/src/session.ts index 00003e0c..309c84f8 100644 --- a/striker-ui-api/src/session.ts +++ b/striker-ui-api/src/session.ts @@ -187,10 +187,10 @@ export default (async () => maxAge: DEFAULT_COOKIE_ORIGINAL_MAX_AGE, secure: false, }, - genid: ({ path }) => { + genid: ({ originalUrl }) => { const sid = uuid(); - stdout(`Generated session identifier ${sid}; request.path=${path}`); + stdout(`Generated session identifier ${sid}; access to ${originalUrl}`); return sid; },