remove User.can_use_fido column: anyone can setup FIDO
This commit is contained in:
parent
e0117e3d67
commit
683b3e54d8
|
@ -85,7 +85,6 @@
|
|||
</div>
|
||||
<!-- END change name & profile picture -->
|
||||
|
||||
{% if current_user.can_use_fido %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-title">Security Key (WebAuthn)</div>
|
||||
|
@ -102,7 +101,6 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card" id="totp">
|
||||
<div class="card-body">
|
||||
|
|
|
@ -26,13 +26,6 @@ class FidoTokenForm(FlaskForm):
|
|||
@login_required
|
||||
@sudo_required
|
||||
def fido_setup():
|
||||
if not current_user.can_use_fido:
|
||||
flash(
|
||||
"This feature is currently in invitation-only beta. Please send us an email if you want to try",
|
||||
"warning",
|
||||
)
|
||||
return redirect(url_for("dashboard.index"))
|
||||
|
||||
if current_user.fido_uuid is not None:
|
||||
fidos = Fido.filter_by(uuid=current_user.fido_uuid).all()
|
||||
else:
|
||||
|
|
|
@ -166,13 +166,8 @@ class User(db.Model, ModelMixin, UserMixin):
|
|||
# Fields for WebAuthn
|
||||
fido_uuid = db.Column(db.String(), nullable=True, unique=True)
|
||||
|
||||
# whether user can use Fido
|
||||
can_use_fido = db.Column(
|
||||
db.Boolean, default=False, nullable=False, server_default="0"
|
||||
)
|
||||
|
||||
def fido_enabled(self) -> bool:
|
||||
if self.can_use_fido and self.fido_uuid is not None:
|
||||
if self.fido_uuid is not None:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue