Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 340f1b5

Browse files
committed
Merge pull request binux#282 from littlezz/fix-flask-login
Fix issue-280
2 parents f454389 + 28467a3 commit 340f1b5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pyspider/webui/login.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414
login_manager.init_app(app)
1515

1616

17+
class AnonymousUser(login.AnonymousUserMixin):
18+
19+
def is_anonymous(self):
20+
return True
21+
22+
def is_active(self):
23+
return False
24+
25+
def is_authenticated(self):
26+
return False
27+
28+
def get_id(self):
29+
return
30+
31+
1732
class User(login.UserMixin):
1833

1934
def __init__(self, id, password):
@@ -32,6 +47,9 @@ def is_active(self):
3247
return self.is_authenticated()
3348

3449

50+
login_manager.anonymous_user = AnonymousUser
51+
52+
3553
@login_manager.request_loader
3654
def load_user_from_request(request):
3755
api_key = request.headers.get('Authorization')

0 commit comments

Comments
 (0)