mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-02 15:11:13 -04:00
remove logged_in_elsewhere as per code review feedback
This commit is contained in:
@@ -151,8 +151,6 @@ def sign_in():
|
||||
return redirect(redirect_url)
|
||||
return redirect(url_for("main.show_accounts_or_dashboard"))
|
||||
|
||||
other_device = current_user.logged_in_elsewhere()
|
||||
|
||||
token = generate_token(
|
||||
str(request.remote_addr),
|
||||
current_app.config["SECRET_KEY"],
|
||||
@@ -166,7 +164,6 @@ def sign_in():
|
||||
return render_template(
|
||||
"views/signin.html",
|
||||
again=bool(redirect_url),
|
||||
other_device=other_device,
|
||||
initial_signin_url=url,
|
||||
)
|
||||
|
||||
|
||||
@@ -140,11 +140,6 @@ class User(JSONModel, UserMixin):
|
||||
set_by_id=set_by_id,
|
||||
)
|
||||
|
||||
def logged_in_elsewhere(self):
|
||||
# This check is deprecated due to the transition to using login.gov.
|
||||
return False
|
||||
# return session.get("current_session_id") != self.current_session_id
|
||||
|
||||
def activate(self):
|
||||
if self.is_pending:
|
||||
user_data = user_api_client.activate_user(self.id)
|
||||
@@ -198,7 +193,7 @@ class User(JSONModel, UserMixin):
|
||||
|
||||
@property
|
||||
def is_authenticated(self):
|
||||
return not self.logged_in_elsewhere() and super(User, self).is_authenticated
|
||||
return super(User, self).is_authenticated
|
||||
|
||||
@property
|
||||
def platform_admin(self):
|
||||
@@ -676,10 +671,6 @@ class InvitedOrgUser(JSONModel):
|
||||
|
||||
|
||||
class AnonymousUser(AnonymousUserMixin):
|
||||
# set the anonymous user so that if a new browser hits us we don't error http://stackoverflow.com/a/19275188
|
||||
|
||||
def logged_in_elsewhere(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def default_organization(self):
|
||||
|
||||
@@ -6,7 +6,6 @@ from tests.conftest import SERVICE_ONE_ID, USER_ONE_ID
|
||||
|
||||
def test_anonymous_user(notify_admin):
|
||||
assert AnonymousUser().is_authenticated is False
|
||||
assert AnonymousUser().logged_in_elsewhere() is False
|
||||
assert AnonymousUser().default_organization.name is None
|
||||
assert AnonymousUser().default_organization.domains == []
|
||||
assert AnonymousUser().default_organization.organization_type is None
|
||||
|
||||
Reference in New Issue
Block a user