Laravel apply form with oauth2 – conceptional question

  discord, laravel, oauth-2.0, php

I try to build an application form, where you have to connect with the discord oauth2 after submitting the application. So I already got the whole oauth set up and I could make a button where you connect with discord and then fill out your form. But I’d like to have the form submit and oauth request with the same button. Now the problem I’m facing, I can’t pass adittional data through the oauth request.

My ‘applications’ table has id, discord_id and form data columns. So my first idea was to just store the form data and make a redirect to the discord oauth page, then return back to the controller and add the id. The problem, I can’t pass additional data to the oauth, so I wouldn’t be able to assign the users discord id correctly.

Maybe you guys have any ideas or already worked with discord oauth2.


Source: Ask PHP