React/Flask google oauth2 problem
Hello, i am trying to implement google oauth2 in my flask/react app, and my problem is that my session cookies are lost after i redirect(in the callback route) to my frontend page. I would like to know any way to work around it or if you know about better option how to implement google oauth. Thank you.
Relevant code:
clientsecretsfile = os.path.join(pathlib.Path(file).parent, "clientsecret.json")
flow = Flow.fromclientsecretsfile(
clientsecretsfile=clientsecretsfile,
scopes="https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email", "openid",
redirecturi="http://127.0.0.1:5000/callback"
)
def loginisrequired(function): #a function to check if the user is authorized or not
def wrapper(*args, **kwargs):
print(session)
if "googleid" not in session: #authorization required
return abort(401)
/r/flask
https://redd.it/zpajdn
Hello, i am trying to implement google oauth2 in my flask/react app, and my problem is that my session cookies are lost after i redirect(in the callback route) to my frontend page. I would like to know any way to work around it or if you know about better option how to implement google oauth. Thank you.
Relevant code:
clientsecretsfile = os.path.join(pathlib.Path(file).parent, "clientsecret.json")
flow = Flow.fromclientsecretsfile(
clientsecretsfile=clientsecretsfile,
scopes="https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email", "openid",
redirecturi="http://127.0.0.1:5000/callback"
)
def loginisrequired(function): #a function to check if the user is authorized or not
def wrapper(*args, **kwargs):
print(session)
if "googleid" not in session: #authorization required
return abort(401)
/r/flask
https://redd.it/zpajdn