From e48e2d0d15818d5a52f8652c86c719d210fe2759 Mon Sep 17 00:00:00 2001 From: Benjamin Schieder Date: Wed, 26 Apr 2017 07:45:34 +0100 Subject: [PATCH] remember last instance for 2 weeks --- RSSTootalizer/Website/Login.pm | 2 ++ RSSTootalizer/Website/OAuthLogin.pm | 1 + static/templates/Login.html | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RSSTootalizer/Website/Login.pm b/RSSTootalizer/Website/Login.pm index 7ba7dd2..6c44f2a 100644 --- a/RSSTootalizer/Website/Login.pm +++ b/RSSTootalizer/Website/Login.pm @@ -20,6 +20,8 @@ sub prerender { $self->{"template"} = "Login"; $self->{"content_type"} = "html"; $self->{"params"}->{"currentmode"} = "Login"; + + $self->{"params"}->{"instance"} = $main::FORM{"last_instance"}; } 1; diff --git a/RSSTootalizer/Website/OAuthLogin.pm b/RSSTootalizer/Website/OAuthLogin.pm index 76b2949..e240c2c 100644 --- a/RSSTootalizer/Website/OAuthLogin.pm +++ b/RSSTootalizer/Website/OAuthLogin.pm @@ -40,6 +40,7 @@ sub prerender { my $user = RSSTootalizer::User->authenticate(); if ($user){ $self->{params}->{token_is_valid} = "true"; + $self->{set_cookie} = ("last_instance=$instance; Max-Age=1209600"); } # {"error":"The access token is invalid"} } diff --git a/static/templates/Login.html b/static/templates/Login.html index 692400a..c4d892b 100644 --- a/static/templates/Login.html +++ b/static/templates/Login.html @@ -4,7 +4,7 @@
- + " required autofocus>