parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Override default functionality for Parse Server express routes

Open simontong opened this issue 3 years ago • 3 comments
trafficstars

New Feature / Enhancement Checklist

Current Limitation

Currently, it's not possible to modify the default routing behaviour for Parse Server. For example, we want to be able to customise our login to be handled outside of Parse's own handler and then respond to the client seamlessly as if they are interacting with Parse. At present, there isn't a clean way to achieve this.

Feature / Enhancement Description

An interface to override specific routes with custom functionality.

Example Use Case

We want to override Parse's default login functionality and implement my own that reaches out to a third party API. Once the response is returned from said API, it would pass down the correct response to satisfy the client without any code changes required client-side.

Alternatives / Workarounds

Iterating over mounted routes and overriding the express handler function.

3rd Party References

No

simontong avatar Aug 10 '22 22:08 simontong

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

I assume https://github.com/parse-community/parse-server/pull/7079 would also not help, because you are looking to completely override the login route, correct?

mtrezza avatar Aug 11 '22 09:08 mtrezza

I assume #7079 would also not help, because you are looking to completely override the login route, correct?

You're correct, it wouldn't help for our use case. The issue with leveraging a custom auth adapter is it would require modifying all the clients to send the additional authData property.

simontong avatar Aug 11 '22 19:08 simontong