首页 > 解决方案 > Auth0 Rule Not Working w/ API Call from React Native App

问题描述

I’ve been using Auth0 in my React web app. I also have a rule that works with new user sign ups. In my web (React) app, I use the Lock library and everything works fine.

Now, I created a React Native mobile app and because I have a custom login/sign up UI, I had to use the API method as opposed to using an Auth0 library such as Lock, etc.

My SignUp API calls work fine and create new users but my rule is NOT working with API calls. I checked to see if rules apply only to my web app but I don’t see any setting for that so I assume all rules should work for all apps that appear on my dashboard – including my new React Native mobile app.

The rule I created on Auth0 creates and assigns a new my_app_id to the new user. This rule has worked flawlessly with all sign ups coming from my web app which uses the Lock library but it doesn't seem to be firing when a new sign up comes in through the sign up API end point.

Is there anything I need to do so that my rule will work with my API calls?

标签: react-nativeauth0

解决方案


Rules only run after a successful authentication event. This would not include a successful signup endpoint call, where no credentials are authenticated.

The recommended way to hook to a signup would be through a registration hook.


推荐阅读