Need some help in Discord oauth

Hey.

I am making my own private Discord oauth plugin, because the existing solutions asking for too much permissions. It works 99% of the time, but it gives an error to 1% of the users and prevented them from logging in. It seems that the users who face this errors are also quite random.

and here are the two functons

I’ve made it a plugin, but it’s private.

Here’s how I deploy it

This is my discord redirect

I can’t replicate and take a screenshot of the error, but when I run it step by step, after returnning from the discord oauth page, the step-by-step window shows wf_form_error messages

othertimes, there will be an error saying that
This email is already in use