Error: Invalid OAuth2 redirect_uri

Coming back on this one for anyone that might encounter the same issue in the future:

The issue appeared because I forgot to set an URL in .env and reference it in server.js

In order to fix it:

  1. Add your URL in .env
URL=https://your-strapi.com
  1. Reference it in server.js
module.exports = ({ env, }) => ({
	host: env('HOST', '0.0.0.0'),
	port: env.int('PORT', 1337),
	proxy: true,
	url: env('URL', '0.0.0.0:1337'),
        .................................
});