For someone who is implementing the social login feature of GitHub locally and continuously facing the redirect_uri mismatch problem, using http://127.0.0.1:port/ for the Homepage URL and callback URL starting with http://127.0.0.1:port/ seems to cause the error.
Instead of http://127.0.0.1:port/ TRY USING http://localhost:port/ for both fields.
I am not sure whether the GitHub stopped support or not, this helped me to solve the issue. Many docs use http://127.0.0.1:port/, but it did not work for me.
If anything is wrong with what I said above please comment so I can correct myself!