hanyuu/templates/auth/login-tfa.php

39 lines
1.4 KiB
PHP
Raw Normal View History

2023-10-18 10:34:30 +00:00
<?php
$self->extends('auth/master');
$self->block('content', function() use ($self) {
?>
<form class="auth-login" method="post" action="/login/tfa">
<div class="auth-avatar">
<div class="auth-avatar-image">
<img src="//flashii.net/assets/avatar/<?=$self->userInfo->getId();?>?res=200" alt="">
</div>
</div>
<div class="auth-fields">
<label class="auth-input">
<div class="auth-input-title">
Username
</div>
<div class="auth-input-value">
<input type="text" value="<?=$self->userInfo->getName();?>" readonly>
</div>
</label>
</div>
<div class="auth-buttons">
<?php if(in_array('totp', $self->authMethodNames)): ?>
<a href="/login/tfa/totp" class="auth-button auth-button-primary">Authenticator app (TOTP)</a>
<?php endif; ?>
<?php if(in_array('u2f', $self->authMethodNames)): ?>
<a href="/login/tfa/u2f" class="auth-button auth-button-primary">Security key (U2F)</a>
<?php endif; ?>
<?php if(in_array('backup', $self->authMethodNames)): ?>
<a href="/login/tfa/backup" class="auth-button auth-button-primary">Backup code</a>
<?php endif; ?>
<a href="/login" class="auth-button">Cancel</a>
</div>
</form>
<?php
});