Skip to content

fix(auth): use public registerUser for register() - #108

Merged
matt-rolley merged 2 commits into
v7from
fix/auth-register-user
Oct 6, 2026
Merged

matt-rolley merged 2 commits into
v7from
fix/auth-register-user

Conversation

@matt-rolley

@matt-rolley matt-rolley commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

register() was an alias of createUser (POST /users), which requires create-users permission. Docs advertise public sign-up; unauthenticated callers get 403.

Fix

  • register() calls SDK registerUser (POST /users/register) with email/password and optional registration fields.
  • createUser() remains for privileged/admin-style creation.
  • Public API type: DirectusRegisterInput (returns Promise<void> matching the SDK).
  • Tests and mocks updated accordingly.

Breaking change

register() previously returned Promise<DirectusUser> and accepted the same input as createUser(). It now returns Promise<void> (matching the SDK's registerUser, since POST /users/register returns no body) and accepts only the public registration fields (email, password, first_name, last_name, verification_url). Callers that relied on register() as a privileged-create alias should switch to createUser().

register was an alias of createUser (POST /users), which requires
create-users permission and fails with 403 for public sign-up flows.
Call SDK registerUser (POST /users/register) instead and keep createUser
for privileged admin-style creation.
@vercel

vercel Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nuxt-directus-sdk Ready Ready Preview Oct 5, 2026 4:59pm UTC
nuxt-directus-sdk-playground Ready Ready Preview Oct 5, 2026 4:59pm UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-directus-sdk@108

commit: 05df77a

@matt-rolley
matt-rolley changed the base branch from next to main July 22, 2026 13:07
@matt-rolley
matt-rolley changed the base branch from main to v7 October 6, 2026 08:55
@matt-rolley
matt-rolley merged commit 4e46b9f into v7 Oct 6, 2026
5 checks passed

This branch was successfully deployed

2 active deployments
Preview – nuxt-directus-sdk-playground — 05df77a3 Deployed Oct 5, 2026 by vercel[bot]
Preview – nuxt-directus-sdk — 05df77a3 Deployed Oct 5, 2026 by vercel[bot]
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.

1 participant