Skip to content

Commit

Permalink
Adjust session provider early return logic (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
polishq authored Oct 3, 2024
1 parent 2bc7c78 commit 07a9434
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
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

0 comments on commit 07a9434

Please sign in to comment.