@@ -123,7 +123,7 @@ def get_affiliation_invitation(affiliation_invitation_id):
123123@_jwt .has_one_of_roles ([Role .STAFF_CREATE_ACCOUNTS .value , Role .STAFF_MANAGE_ACCOUNTS .value , Role .PUBLIC_USER .value ])
124124def patch_affiliation_invitation (affiliation_invitation_id ):
125125 """Update the affiliation invitation specified by the provided id."""
126- origin = request .environ .get ("HTTP_ORIGIN" , "localhost" )
126+ origin = request .environ .get ("HTTP_ORIGIN" , current_app . config . get ( "WEB_APP_URL" ) )
127127 request_json = request .get_json ()
128128 try :
129129 affiliation_invitation = AffiliationInvitationService .find_affiliation_invitation_by_id (
@@ -166,7 +166,7 @@ def delete_affiliation_invitation(affiliation_invitation_id):
166166@_jwt .requires_auth
167167def accept_affiliation_invitation_token (affiliation_invitation_id , affiliation_invitation_token ):
168168 """Check whether the passed token is valid and add affiliation from the affiliation invitation."""
169- origin = request .environ .get ("HTTP_ORIGIN" , "localhost" )
169+ origin = request .environ .get ("HTTP_ORIGIN" , current_app . config . get ( "WEB_APP_URL" ) )
170170 environment = get_request_environment ()
171171
172172 try :
@@ -196,7 +196,7 @@ def accept_affiliation_invitation_token(affiliation_invitation_id, affiliation_i
196196@_jwt .requires_auth
197197def patch_affiliation_invitation_authorization (affiliation_invitation_id , authorize_action ):
198198 """Check if user is active part of the Org. Authorize/Refuse Authorization invite if he is."""
199- origin = request .environ .get ("HTTP_ORIGIN" , "localhost" )
199+ origin = request .environ .get ("HTTP_ORIGIN" , current_app . config . get ( "WEB_APP_URL" ) )
200200 env = get_request_environment ()
201201
202202 try :
0 commit comments