What i'm doing wrong! Setting up login page and action with security provider in nodejs

Hi, i’m setting up a security provide and login in nodejs, i get below error, please help

as i can see i could not select users table and role base condition as use to do in php pages. how that can be done in nodejs?

i have followed this post

Have you tried setting the security provider under Globals

image

Then apply a Login step to the server action

image

I did not. i ll try that now :slight_smile: thanks

Hi, i did global security provider and set the users and permission, what about like you have ‘customers’ , in my case is ‘users’ , do i need to do that ?

i still got 401, even though i use correct username and password, something i’m doing wrong.

Have you set the variables in the server action under $_POST? Looking at your original screenshot, there is no caret indicating variables under POST, thus the server will send null giving you the 401 unauthorised error.

i have those variables, still i get 401, i have doubt that in login action setting identity column, i set to user_id. which i have in my users table. like below:

And just to double check:

  1. You definitely have users in your db table.
  2. The names of your input fields on your login form correspond to the $_POST variables?


image

yes, that all are correct!.. thanks for the reply, can you show role permission setting on login action?

Just as a matter of interest, does your file system look similar to this and does it show securityVfxchange.json where mine shows my two providers?

image

yes, i have only one security provider but it shows without .json
like this securityVfxchange

i got it to work! :slight_smile: i missed the hashing password for $_POST.password

2 Likes

Great news!