Error with authentication

Options
Hello everyone,

I started working with Xano some days ago. I watched the tutorial how to set up the Authentication in Xano, but it didn´t work for me. When I try to Run and Debug the auth/login to get the authToken like the video, it returns this error:


Whoops! An error occurred.

Exception: Invalid name: mvpw2605:13134


On Youtube Xano's channel, they have said to me this error happens when I don't have any users in my database. But I have a table called "user" and these 3 test users registered in:[Xano - Users.png]
The same error happens in both situations:

Login:[Xano - Login error.png]
Sign up:[Xano - Sign up error.png]
Can anyone help me? I would be grateful for this!

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hi  thanks for writing in.

    You had a number of things wrong:

    First, it appears that you deleted your original user table and created a new one. This is fine but you need to be very careful how you set things back with functions interacting with this table. You should delete the functions interacting with the deleted table.

    [Screenshot_2021-06-16_18-45-59.png]
    Additionally, you were looking up the user table based on the id field. However, in the sign up and log in endpoint there is no id as an input, you should use the email field as this is uniquely indexed to ensure you are getting a unique user.

    [Screenshot_2021-06-16_18-49-55.png]
    Additionally, you must make sure the authToken is linked up to the correct user table.

    For the login endpoint, there were similar issues with the function referencing the table that no longer exists. Additionally, the user_id in the authToken must be linked up to an existing variable. Lastly, there was no response in this API so I added the authToken back

    [Screenshot_2021-06-16_18-51-16.png]
    I made the appropriate changes - I commented out the functions that are not valid, which you should delete.
  • Jesse Lima
    Jesse Lima Member
    Options
     Thank you very much. I made the changes you said and showed above and now the auth/login, auth/signup and auth/me are working.😄
  • Noor
    Noor Member
    Options

    Hello, @Michael Udinski
    I also deleted user table and when I create and setup the the /auth/me API it return all values as expect in run and debug but when I try to access it from REACT its says Invalid name: mvpw27562:141359
    the screen is attached below:

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hey @Noor were the changes published before calling it from your front-end? And are the URLs the exact same for the endpoint or different?

  • Noor
    Noor Member
    Options

    @Michael Udinski the changes were published and URLs are exact same. As it shows some exception I create a new API which working fine for me.

  • Ambroise
    Ambroise Member
    Options

    Also ran into this today. I had deleted my User table, too. (because of a Xano bug with indexes)

    It's a very bad UX not to have any warning in the Xano app that there are some endpoints that are completely broken.