From a08a4be89ecab9fe40d1711f7994f8fa40a8e2f0 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 8 Aug 2023 18:15:31 +0200 Subject: [PATCH] Fix Traewelling OAuth2 behind reverse proxies a reverse proxy makes mojolicious believe that it is using HTTP, even though it is HTTPS. --- lib/Travelynx/Controller/Traewelling.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Travelynx/Controller/Traewelling.pm b/lib/Travelynx/Controller/Traewelling.pm index e14872d..f1f24e7 100644 --- a/lib/Travelynx/Controller/Traewelling.pm +++ b/lib/Travelynx/Controller/Traewelling.pm @@ -25,7 +25,12 @@ sub oauth { my $oa = $self->config->{traewelling}{oauth}; return $self->oauth2->get_token_p( - traewelling => { scope => 'read-statuses write-statuses' } )->then( + traewelling => { + redirect_uri => $self->base_url_for('/oauth/traewelling') + ->to_abs->scheme('https')->to_string, + scope => 'read-statuses write-statuses' + } + )->then( sub { my ($provider) = @_; if ( not defined $provider ) {