Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust session provider early return logic #164

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Adjust session provider early return logic

## [1.44.8] - 2024-10-02

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions node/resolvers/Routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ export const Routes = {

const ignoreB2B = body?.public?.removeB2B?.value

if (ignoreB2B || !email) {
if (ignoreB2B) {
ctx.response.body = response
ctx.response.status = 200

return
}

if (b2bImpersonate) {
if (email && b2bImpersonate) {
try {
user = (await getUser({
masterdata,
Expand Down Expand Up @@ -212,6 +212,13 @@ export const Routes = {
email = telemarketingEmail
}

if (!email) {
ctx.response.body = response
ctx.response.status = 200

return
}

if (user === null) {
user = (await getActiveUserByEmail(null, { email }, ctx).catch(
(error) => {
Expand Down
Loading