Replies: 4 comments
-
I have the same problem |
Beta Was this translation helpful? Give feedback.
-
Add this to your settings.py
USE_X_FORWARDED_HOST = True
El El sáb, 16 may. 2020 a la(s) 17:11, Bastilla123 <[email protected]>
escribió:
I have the same problem
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1093>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQK5U5E7LLHIHN67IK5NJTRR3XNRANCNFSM4NBU6YYQ>
.
--
Enviado con Gmail Mobile
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem i used node.js , http-proxy-middleware i can't custom HOST in redirect_uri |
Beta Was this translation helpful? Give feedback.
-
this url maybe help to you python-social-auth/social-app-django#31 (comment) my way:i used node.js , http-proxy-middleware i change my Proxy setting, it's works in my project here is my code : old code, can't work,i got a error : /* eslint-disable no-console */
const express = require('express');
const next = require('next');
const devProxy = {
'/api': {
target: 'http://0.0.0.0:8000/',
changeOrigin: true,
},
};
const port = parseInt(process.env.PORT, 10) || 3000;
const env = process.env.NODE_ENV;
const dev = env !== 'production';
const app = next({
dir: '.', // base directory where everything is, could move to src later
dev,
});
const handle = app.getRequestHandler();
let server;
app
.prepare()
.then(() => {
server = express();
// Set up the proxy.
if (dev && devProxy) {
const {createProxyMiddleware} = require('http-proxy-middleware');
Object.keys(devProxy).forEach(function (context) {
server.use(createProxyMiddleware(context, devProxy[context]));
});
}
server.all('*', (req, res) => {
handle(req, res);
});
server.listen(port, err => {
if (err) {
throw err;
}
console.log(`> Ready on port ${port} [${env}]`);
});
})
.catch(err => {
console.log('An error occurred, unable to start the server');
console.log(err);
}); new code, it's works for me/* eslint-disable no-console */
const express = require('express');
const next = require('next');
const devProxy = {
'/api': {
target: 'http://0.0.0.0:8000/',
changeOrigin: true,
headers: {
Host: 'mydomain.com',
Origin: 'mydomain.com'
},
},
};
const port = parseInt(process.env.PORT, 10) || 3000;
const env = process.env.NODE_ENV;
const dev = env !== 'production';
const app = next({
dir: '.', // base directory where everything is, could move to src later
dev,
});
const handle = app.getRequestHandler();
let server;
app
.prepare()
.then(() => {
server = express();
// Set up the proxy.
if (dev && devProxy) {
const {createProxyMiddleware} = require('http-proxy-middleware');
Object.keys(devProxy).forEach(function (context) {
server.use(createProxyMiddleware(context, devProxy[context]));
});
}
server.all('*', (req, res) => {
handle(req, res);
});
server.listen(port, err => {
if (err) {
throw err;
}
console.log(`> Ready on port ${port} [${env}]`);
});
})
.catch(err => {
console.log('An error occurred, unable to start the server');
console.log(err);
}); what i dojust add headers: {
Host: 'mydomain.com',
Origin: 'mydomain.com'
}, |
Beta Was this translation helpful? Give feedback.
-
Iḿ having an issue with a django / facebook login. When redirected to facebook I noticed that the redirect URL is set as follow:
redirect_uri=https://127.0.0.1:8001/social-auth/complete/facebook/&state=LppYImgn2B4X53ZpWunR7M3mIR6E4Rvh&return_scopes=true&scope=email
facebook complains and says the URL is not valid. Iḿ not sure where this URL comes from.
Beta Was this translation helpful? Give feedback.
All reactions