You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Client verifyEmail() always fails: '_system.user.verifyEmail' is not defined #421
verifyEmail({ token }) from modelence/client always rejects with:
Method with name '_system.user.verifyEmail' is not defined.
so the "Manual Verification" flow in docs/web/authentication/email-verification.mdx can't work.
Why
The client calls callMethod('_system.user.verifyEmail', { token }) (src/auth/client/index.ts).
The _system.user module (src/auth/user.ts) registers no verifyEmail mutation. Its mutations are signupWithPassword, loginWithPassword, logout, resendEmailVerification, sendResetPasswordToken, resetPassword, sendMagicLink, loginWithMagicLink, loginWithOneTimeCode, loginWithOAuth, updateProfile and unlinkOAuthProvider.
Email verification only exists as the GET route /api/_internal/auth/verify-email (handleVerifyEmail in src/auth/verification.ts), which is what the emailed link uses.
The client test (src/auth/client/index.test.ts, "verifyEmail calls backend method with token") only checks that callMethod receives that name, so the missing server method isn't caught.
Proposed fix
Option A, which I'd suggest: add a verifyEmail mutation to the _system.user module that reuses verifyEmailToken(token) from verification.ts and fires onAfterEmailVerification / onEmailVerificationError like the route does. Plus a test that every _system.user.* method the client calls is registered on the server.
Open question for A: should the mutation also create a session the way the GET route does? I'd leave that out and only verify the email, since the caller may not be the account owner's current browser.
Option B: remove or deprecate the client verifyEmail export and the "Manual Verification" docs section, if the emailed link is meant to be the only path.
Activity