Ensure google authentication can be completed successfully, while pgAdmin is running in behind proxy servers. #5750
parent
12f82820c9
commit
501bff6f7a
|
@ -12,6 +12,7 @@ import pickle
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from urllib.parse import unquote
|
||||||
|
|
||||||
from config import root
|
from config import root
|
||||||
from pgadmin.utils.csrf import pgCSRFProtect
|
from pgadmin.utils.csrf import pgCSRFProtect
|
||||||
|
@ -80,6 +81,7 @@ def verify_credentials():
|
||||||
error = None
|
error = None
|
||||||
res_data = {}
|
res_data = {}
|
||||||
|
|
||||||
|
client_secret_path = unquote(client_secret_path)
|
||||||
try:
|
try:
|
||||||
client_secret_path = \
|
client_secret_path = \
|
||||||
filename_with_file_manager_path(client_secret_path)
|
filename_with_file_manager_path(client_secret_path)
|
||||||
|
@ -102,7 +104,11 @@ def verify_credentials():
|
||||||
_google = pickle.loads(session['google']['google_obj'])
|
_google = pickle.loads(session['google']['google_obj'])
|
||||||
|
|
||||||
# get auth url
|
# get auth url
|
||||||
auth_url, error_msg = _google.get_auth_url(request.host_url)
|
host_url = request.origin + '/'
|
||||||
|
if request.root_path != '':
|
||||||
|
host_url = host_url + request.root_path + '/'
|
||||||
|
|
||||||
|
auth_url, error_msg = _google.get_auth_url(host_url)
|
||||||
if error_msg:
|
if error_msg:
|
||||||
error = error_msg
|
error = error_msg
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue