Hi Osioke, thank you for your reply.
I did follow the guide and still couldn’t get it fixed, I eventually found a fix on my own.
Apparently the callback URL from the guide isn’t quite correct, I changed it from https://mydomain/auth/callback/github to https://mydomain/auth/github and everything works well.
Perhaps the guide should be updated for future readers.