dbAuth - How to bypass duplicate usernames check

I am using OAuth Plug In, but trying to customize it to my particular use-case.

If user has already signed up using one of the provider and tries to setup password for the account, I wanna detect this, and give user an option to create a password and link account.

But in api/src/function/auth.ts, signupOptions does not have an opportunity for checking duplicate usernames and redwoodjs throws without control ever reaching signupOptions.

Is there a way to check this myself bypassing just the duplicate username check?

My goal is to throw a specific error from the backend, show modal to give opportunity to login via already signed up provider, or link accounts. If account is linked, I will be saving password hash, salt, etc. in the User table.

Update 1: I went ahead and made two calls from frontend to API side. If error is username already in use, then i make first call to get the provider, if any. If there exists a provider, second call is to link two accounts. The only problem with this is I am myself computing password hash and salt. I referred to redwoodjs code for it. It would be nicer to let redwood do it, and check it user already exists due to being available via different provider, saving me one round trip.

Replied to you on the other thread here: 🎉 Announcing dbAuth OAuth Plugin v2.0.0 - easily enable Sign in with Apple, GitHub, Google, and more! - #34 by arimendelow

The flow you’re proposing here, though, is much more complex.

I asked over there, but I’ll ask here as well: are you currently attempting to build a specific app? Or are you just trying to learn FSD and are particularly interested in learning more about building auth flows?