Moltin Authentication - Register / Login


#1

So I am using the API endpoints to create new users and to sign them in. All working fine, but I would like to add a USERNAME for when the user registers an account. What is the best way to do this? and would there be a way to validate the username before submitting it (obvis we can’t have duplicate usernames). I was hoping to do something like this:

method: ‘post’,
url: v2/customers,
data: {
data: {
emai: ‘foo@foo.com’,
password: ‘foo’,
username: ‘foo’
}
}


#2

Hi @monkemedia

You can do this using Flows. You’ll need to extend the customers resource and add a field for username.

The video below covers how you can extend customer addresses with Flows. The same applies for customers.

Then on your request, simply pass the username with the payload and you’re good to go.

I believe there is a bug with the unique boolean, so keep in mind that doesn’t actually check it’s unique before it creates the record.

I hope this helps :slight_smile:


#3

Brilliant… can’t wait to watch the video


#4

It works… strange that the dashboard doesn’t update though


#5

Ignore the last comment… its now updating in dashboard


#6

Woohoo! Enjoy :smiley:


#7

Oooo doesn’t check to see if username is unique (string)


#8

Hi @monkemedia

Yeah this is a know issue and logged internally, we’ll push a fix as soon as we can! :smile:

I believe there is a bug with the unique boolean, so keep in mind that doesn’t actually check it’s unique before it creates the record.


#9

Oh sorry, I thought you meant the boolean from the select dropdown…


#10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.