remove logged_in_elsewhere as per code review feedback

This commit is contained in:
Kenneth Kehl
2024-05-08 12:45:01 -07:00
parent 852c0e57c8
commit 26988d255f
3 changed files with 1 additions and 14 deletions

View File

@@ -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,
)

View File

@@ -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):

View File

@@ -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