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

chore: Excluding certain event_types from processing uid #2370

Merged
merged 20 commits into from
Apr 15, 2024

Conversation

pragatimodi
Copy link
Contributor

@pragatimodi pragatimodi commented Nov 14, 2023

(internal change)

Payload body:

{
  "iss": "",
  "aud": "",
  "iat": "",
  "exp": "",
  "event_id": "",
  "event_type": "beforeCreate",
  "user_agent": "",
  "ip_address": "",
  "locale": "",
  "sign_in_method": "",
  "sub": "",
  "user_record": {
    "uid": "NzZjFR0TDsWwxYUuPvkfUfWkZx73",
    "email": "abcd@example.com",
    "email_verified": false,
    "provider_data": [
      {
        "provider_id": "",
        "email": "abcd@example.com",
        "uid": "abcd@example.com"
      }
    ],
    "metadata": {
      "last_sign_in_time": "",
      "creation_time": ""
    }
  }
}

Since the event types beforeSendSms and beforeSendEmail do not include user record in the payload, we exclude them from processing sub which is the same as uid which is a part of user record.

@pragatimodi pragatimodi marked this pull request as draft November 14, 2023 18:05
@pragatimodi pragatimodi marked this pull request as ready for review January 10, 2024 19:08
Copy link
Contributor

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM.
Please hold off on the merging before code-freeze lift.

src/auth/token-verifier.ts Show resolved Hide resolved
Copy link
Contributor

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you able to add unit tests for this?

@pragatimodi pragatimodi changed the title adding optional param to token verifier excluding certain event_types from processing uid Mar 18, 2024
Copy link
Contributor

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome LGTM

src/auth/token-verifier.ts Outdated Show resolved Hide resolved
src/auth/token-verifier.ts Outdated Show resolved Hide resolved
pragatimodi and others added 3 commits March 21, 2024 11:04
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants