• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 15402553041
72%

Build:
DEFAULT BRANCH: master
Ran 02 Jun 2025 08:59PM UTC
Jobs 1
Files 140
Run time 1334min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Jun 2025 08:52PM UTC coverage: 70.144% (+0.1%) from 70.032%
15402553041

push

github

web-flow
feat: hooks round 5 (Option 2) - add before-user-created hook (#2034)

## Hooks Round 5 - Option 2

This PR contains Option 1 for implementing the `before-user-created`
hook. See https://github.com/supabase/auth/pull/2032 for option 1.

### Summary

This commit explores one possible implementation of this hook by:
- Adding a `triggerBeforeUserCreated` method to the `*API` object in
`internal/api/hooks.go`
- Adding a `triggerBeforeUserCreatedExternal` method to the `*API`
object in `internal/api/hooks.go`
- Updating callers of `signupNewUser` to first call
`triggerBeforeUserCreated` in:
    - internal/api/anonymous.go
    - internal/api/external.go
    - internal/api/invite.go
    - internal/api/mail.go
    - internal/api/signup.go
- Updating callers of `signupNewUser` to first call
`triggerBeforeUserCreatedExternal` in:
    - internal/api/external.go
    - internal/api/samlacs.go
    - internal/api/token_oidc.go
    - internal/api/web3.go
- Add end to end tests in `internal/api/e2e_test.go`

This has the benefit of being outside the transaction, but is a bit more
complex. I make a best-effort to ensure I only trigger
before-user-created when the user doesn't exist, but being outside the
transaction there is a small chance for duplicate calls or calls that
happen when a user already has been created. The main thought here is
that we can document this behavior and the tradeoff is worth the
benefits.

### Depends on

[feat: hooks round 1](https://github.com/supabase/auth/pull/2023) -
prepare package structure
* renamed pkg `internal/hooks/v0hooks/v0http` ->
`internal/hooks/hookshttp`
[8a398ab](https://github.com/supabase/auth/pull/2023/commits/<a class=hub.com/supabase/auth/commit/8a398aba564267e4caa4c32bf661699d47d29174">8a398aba5)
* renamed pkg `internal/hooks/v0hooks/v0pgfunc` ->
`internal/hooks/hookspgfunc`
[8a398ab](https://github.com/supabase/auth/pull/2023/commits/8a398aba564267e4caa4c32bf661699d47d29174)
* use pkg `internal/e2e` for test setup in:
* pkg `internal/hooks/hookspgfunc`
[4d60288](ht... (continued)

181 of 277 new or added lines in 16 files covered. (65.34%)

2 existing lines in 2 files now uncovered.

11284 of 16087 relevant lines covered (70.14%)

67.39 hits per line

Jobs
ID Job ID Ran Files Coverage
1 15402553041.1 02 Jun 2025 08:59PM UTC 0
70.14
GitHub Action Run
Source Files on build 15402553041
Detailed source file information is not available for this build.
  • Back to Repo
  • b53f6b0d on github
  • Prev Build on master (#15271853198)
  • Next Build on master (#15427124118)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc