Optional Auth on API endpoint
What would be the best way to allow auth + non auth users access the same endpoint and adapt function stack accordingly? (e.g. conditional doing one thing for auth users, other thing for non auth requests to that endpoint)
Comments
-
Instead of default authentication, use the authentication inside the if-else.
-
I was trying to use Conditional with auth.id condition but auth is not avaiable unless I enable default auth on the endpoint.
-
If you want to use built-in authentication, the endpoint needs to have Xano pre-process it. If you want shared functionality for auth/nonauth, I would do it with two endpoints that both call a common function.
-
Exactly as Ray described. Because our authentication tokens are encrypted, there isn't a method to decrypt them at this time. We can definitely look into adding support for this, though. Can you please submit a feature request here? Thank you!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback