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

How do you Sign up a new user from the SDK #65

Open
NickoftheSouth opened this issue May 12, 2023 · 1 comment
Open

How do you Sign up a new user from the SDK #65

NickoftheSouth opened this issue May 12, 2023 · 1 comment

Comments

@NickoftheSouth
Copy link

I've tried code like this:

      DirectusUser user = DirectusUser(
         email: email,
         password: password,
         firstName: firstName,
         lastName: lastName)

      final DirectusResponse<DirectusUser> response = await _sdk!.users.createOne(user);

This works but you do need to make creating users public.

But I can't seem to work out how to add a user with additional fields.

I've tried swapping out DirectusUser with my custom user class (which extends DirectusUser). this creates the user but none of my additional fields are set on the new user.

What am I missing here?

Testing in the Andriod simulator under Windows
Library version: directus: ^0.11.0

@apstanisic
Copy link
Owner

This package is only providing features that API provides, and they are not currently providing register method see available methods.

As for custom fields, there is already an open issue #56. It's not as easy as JS SDK since Dart is not dynamically typed like JS/TS.

I'm open for proposals on how to implement custom fields in a clean way

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

No branches or pull requests

2 participants