summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-10-04 12:47:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-10-04 12:47:09 +0200
commite13b5afe4f23648358c01a4d3809d0ccf46c592f (patch)
treec1bdce87d3c0149b5855665284183c9d13a9748f /lib/Travelynx/Helper
parent562dd7ccaef9270070d142e9d6cfe8aa164e072e (diff)
Traewelling checkin: Handle invalid / revoked bearer tokens
Diffstat (limited to 'lib/Travelynx/Helper')
-rw-r--r--lib/Travelynx/Helper/Traewelling.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Travelynx/Helper/Traewelling.pm b/lib/Travelynx/Helper/Traewelling.pm
index 2a522e5..48fc16d 100644
--- a/lib/Travelynx/Helper/Traewelling.pm
+++ b/lib/Travelynx/Helper/Traewelling.pm
@@ -323,6 +323,19 @@ sub checkin {
);
return;
}
+
+ # Work around https://github.com/Traewelling/traewelling/issues/128
+ if ( $tx->res->code == 302 ) {
+ my $err_msg = "Der Login-Token wurde nicht akzeptiert";
+ $self->{log}->debug("... error: $err_msg");
+ $self->{model}->log(
+ uid => $opt{uid},
+ message =>
+ "Fehler bei $opt{train_type} $opt{train_no}: $err_msg",
+ is_error => 1
+ );
+ return;
+ }
$self->{log}->debug( "... success! " . $tx->res->body );
# As of 2020-10-04, traewelling.de checkins do not yet return