Skip to content

Commit

Permalink
fix: /.well-known/change-password (#9285)
Browse files Browse the repository at this point in the history
fix: /.well-known/change-password #9223
  • Loading branch information
stephanegigandet authored Nov 15, 2023
1 parent b9c1bc8 commit 5e7e932
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions conf/nginx/sites-available/off
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ server {
gunzip on;
}

# Redirect to the change password form
location = /.well-known/change-password {
return 307 https://$host/cgi/change_password.pl;
}

# GoogleAssociationService made 2500 requests/min to assetlinks.json
# and much less when caching headers are sent
location = /.well-known/assetlinks.json {
Expand Down
8 changes: 0 additions & 8 deletions lib/ProductOpener/Routing.pm
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,6 @@ sub analyze_request ($request_ref) {
$request_ref->{missionid} = $components[1];
}

# https://github.com/openfoodfacts/openfoodfacts-server/issues/4140
elsif ((scalar(@components) == 2) and ($components[0] eq '.well-known') and ($components[1] eq 'change-password')) {
$request_ref->{redirect} = $formatted_subdomain . '/cgi/change_password.pl';
$log->info('well-known password change page - redirecting', {redirect => $request_ref->{redirect}})
if $log->is_info();
redirect_to_url($request_ref, 307, $request_ref->{redirect});
}

elsif ($#components == -1) {
# Main site
}
Expand Down

0 comments on commit 5e7e932

Please sign in to comment.