Now that Apple requires an account deletion function to be present in every app that has user accounts, I began implementing one for my app. However, I presume there may be security implications here.
I use JWT tokens for authentication in my app, and so the most obvious way is to have a POST endpoint, say /delete-account
that requires usual JWT authentication.
Although this endpoint will be as secure as any other, the consequences of a malicious call to /delete-account
with a stolen JWT are bigger compared to other endpoints.
What comes to mind first is, for example, to require the refresh token to be sent with this request too as an exception.
I was wondering if there's any industry standard way of handling this kind of requests?