Przeglądaj źródła

fix post-auth redirection

Turns out the next URL redirection got cleared from
the session before it gets used. Moved the logic
around to make sure that doesn't happen (#58).
pull/63/head
Chlod Alejandro 5 miesięcy temu
rodzic
commit
903e27e9d8
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: A1E67C59037B0CC1
1 zmienionych plików z 2 dodań i 1 usunięć
  1. +2
    -1
      src/copyvios/auth.py

+ 2
- 1
src/copyvios/auth.py Wyświetl plik

@@ -47,12 +47,13 @@ def oauth_login_end():
"https://meta.wikimedia.org/w/index.php", consumer_token, access_token "https://meta.wikimedia.org/w/index.php", consumer_token, access_token
) )


next_url = session.get("next", "/")
session.clear() session.clear()
session["access_token"] = dict(zip(access_token._fields, access_token)) session["access_token"] = dict(zip(access_token._fields, access_token))
session["username"] = identity["username"] session["username"] = identity["username"]
session.permanent = True session.permanent = True


return session.get("next", "/")
return next_url




def clear_login_session(): def clear_login_session():


Ładowanie…
Anuluj
Zapisz