fix nginx.conf and oauth callback

This commit is contained in:
knst-kotov 2021-11-10 17:10:59 +03:00
parent e84133364b
commit e882ada7bd
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ from urllib.parse import quote_plus
from auth.authorize import Authorize
from auth.identity import Identity
from settings import OAUTH_CLIENTS, OAUTH_CALLBACK_URL
from settings import OAUTH_CLIENTS, BACKEND_URL, OAUTH_CALLBACK_URL
oauth = OAuth()
@ -66,7 +66,7 @@ async def oauth_login(request):
provider = request.path_params['provider']
request.session['provider'] = provider
client = oauth.create_client(provider)
redirect_uri = request.url_for('oauth_authorize')
redirect_uri = "%s/%s" % (BACKEND_URL, 'oauth_authorize')
return await client.authorize_redirect(request, redirect_uri)
async def oauth_authorize(request):

View File

@ -10,6 +10,8 @@
location /graphql {
rewrite ^/graphql/(.*) /$1 break;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
@ -31,4 +33,4 @@ location /graphql {
proxy_set_header X-Forwarded-Port {{ $.PROXY_X_FORWARDED_PORT }};
proxy_set_header X-Forwarded-Proto {{ $.PROXY_X_FORWARDED_PROTO }};
proxy_set_header X-Request-Start $msec;
}
}