Commit the security trackable information and refresh user
@@ -129,6 +129,8 @@ class Ping(Resource):
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(user.id))
login_user(user)
+ db.session.commit()
+ db.session.refresh(user)
return redirect(return_to, code=302)
@@ -210,6 +212,8 @@ class Google(Resource):
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(user.id))
login_user(user)
+ db.session.commit()
+ db.session.refresh(user)
return redirect(return_to, code=302)
@@ -282,6 +286,8 @@ class OneLogin(Resource):
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(user.id))
login_user(user)
+ db.session.commit()
+ db.session.refresh(user)
self_url = OneLogin_Saml2_Utils.get_self_url(self.req)
if 'RelayState' in request.form and self_url != request.form['RelayState']:
