Files
sample-site/login.html
2025-10-06 21:22:13 +09:00

239 lines
8.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html
lang="en-US"
class="light-style customizer-hide"
>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<title>Login - amiPro sample site </title>
<meta name="description" content="" />
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="files/favicon.ico" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<!-- Icons. Uncomment required icon fonts -->
<!-- link rel="stylesheet" href="../assets/vendor/fonts/boxicons.css" / -->
<!-- Core CSS -->
<link rel="stylesheet" href="files/core.css" class="template-customizer-core-css" />
<link rel="stylesheet" href="files/theme-default.css" class="template-customizer-theme-css" />
<link rel="stylesheet" href="files/demo.css" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="files/perfect-scrollbar.css" />
<!-- Page CSS -->
<!-- Page -->
<link rel="stylesheet" href="files/page-auth.css" />
<!-- Helpers -->
<script src="files/helpers.js"></script>
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
<script src="files/config.js"></script>
<script src="files/jquery.js"></script>
<script src="files/popper.js"></script>
<script src="files/bootstrap.js"></script>
<script src="files/perfect-scrollbar.js"></script>
<script src="files/menu.js"></script>
<script src="files/main.js"></script>
<script src="files/amipro_utils.js?v=20230414"></script>
<script src="files/dfido2-lib.js?v=2025092701"></script>
<script>
<!--
// For stand alone: 'https://local.dqj-macpro.com'
// For proxy: set 'https://mac-air-m2.dqj-home.com'
-->
setFidoServerURL('https://mac-air-m2.dqj-home.com');//'https://fido2.amipro.me');
const i18n_messages = new Map();
var lang_map = new Map();
lang_map.set("en-US", "Welcome to amiPro sample site!");
lang_map.set("zh-CN", "欢迎来到 amiPro 示例网站!");
lang_map.set("ja", "amiPro サンプルサイトへようこそ!");
i18n_messages.set("msg_welcome", lang_map);
lang_map = new Map();
lang_map.set("en-US", "Please sign in to your account and register your devices.");
lang_map.set("zh-CN", "请登录您的帐户并注册设备。");
lang_map.set("ja", "アカウントにサインインして、デバイスを登録してください。");
i18n_messages.set("msg_intro", lang_map);
lang_map = new Map();
lang_map.set("en-US", "USER ID");
lang_map.set("zh-CN", "用户ID");
lang_map.set("ja", "ユーザーID");
i18n_messages.set("msg_uid", lang_map);
lang_map = new Map();
lang_map.set("en-US", "PASSWORD");
lang_map.set("zh-CN", "密码");
lang_map.set("ja", "パスワード");
i18n_messages.set("msg_pw", lang_map);
lang_map = new Map();
lang_map.set("en-US", "Any password can sign in");
lang_map.set("zh-CN", "任意密码可登录");
lang_map.set("ja", "任意のパスワードでログインできます");
i18n_messages.set("msg_pw_intro", lang_map);
lang_map = new Map();
lang_map.set("en-US", "Sign in");
lang_map.set("zh-CN", "登录");
lang_map.set("ja", "ログイン");
i18n_messages.set("msg_sign_in", lang_map);
lang_map = new Map();
lang_map.set("en-US", "Input User ID, please!");
lang_map.set("zh-CN", "请输入用户ID");
lang_map.set("ja", "ユーザーIDを入力してください");
i18n_messages.set("msg_uid_input", lang_map);
lang_map = new Map();
lang_map.set("en-US", "Passwordless login");
lang_map.set("zh-CN", "无密码登录");
lang_map.set("ja", "パスワードレス ログイン");
i18n_messages.set("title_fido2_login", lang_map);
window.onload = function() {
logoutFido2UserSession();
if(canTryAutoAuthentication()){
lang_map = new Map();
lang_map.set("en-US", "If automatic login fails, enter your user ID and click Passwordless login.");
lang_map.set("zh-CN", "如果自动登录失败请输入用户ID并点击“无密码登录”。");
lang_map.set("ja", "自動ログインに失敗した場合は、ユーザーIDを入力して「パスワードレス ログイン」をクリックしてください。");
i18n_messages.set("msg_intro", lang_map);
setI18NText(i18n_messages)
authenticate()
}else{
setI18NText(i18n_messages)
}
}
async function authenticate(){
var uid = $('#uid').val()
if(uid && 0==uid.length)uid=null
const result = await authenticateFido2(uid)
if(result.status === 'ok'){
//Set your logged in status and jump to user's top page.
location.href = 'devices.html?uid='+result.username
}else{
errProcessFido2(result)
}
}
function checkInput(){
const uid = $('#uid').val()
if(!uid || 0>=uid.length){
alert($('#msg_uid_input').html())
return false;
}else return true;
}
</script>
</head>
<body>
<!-- Content -->
<div class="container-xxl">
<div class="authentication-wrapper authentication-basic container-p-y">
<div class="authentication-inner">
<!-- Register -->
<div class="card">
<div class="card-body">
<!-- Logo -->
<div class="app-brand justify-content-center">
<a href="https://www.amiPro.me/" class="app-brand-link gap-2">
<img style="width:160px;" src="files/favicon.ico"/>
</a>
</div>
<!-- /Logo -->
<h4 class="mb-2" id="msg_welcome">Welcome to amiPro sample site!</h4>
<p class="mb-4" id="msg_intro">Please sign-in to your account and start the adventure</p>
<div id="msg_uid_input" style="display:none;">Input User ID, please!</div>
<form class="mb-3" action="devices.html" method="GET" onsubmit="return checkInput();">
<div class="mb-3">
<label for="email" class="form-label" id="msg_uid" name="uid">User ID</label>
<input
type="text"
class="form-control"
id="uid"
name="uid"
placeholder="Enter your User ID"
autofocus
/>
</div>
<div class="mb-3 form-password-toggle">
<div class="d-flex justify-content-between">
<label class="form-label" for="password" id="msg_pw">Password</label>
<small id="msg_pw_intro">Any password can login</small>
</div>
<div class="input-group input-group-merge">
<input
type="password"
id="password"
class="form-control"
name="password"
placeholder="&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;&#xb7;"
aria-describedby="password"
/>
<span class="input-group-text cursor-pointer"><i class="bx bx-hide"></i></span>
</div>
</div>
<div class="mb-3">
<button class="btn btn-primary d-grid w-100" style="background-color: #ce59d9;border-color: #ce59d9;" id="msg_sign_in">Sign in</button>
</div>
</form>
<p class="text-center" id="fido_btn">
<a href="javascript:authenticate(true);">
<span id="title_fido2_login">Passwordless login</span>
</a>
</p>
</div>
</div>
<!-- /Register -->
</div>
</div>
</div>
<!-- / Content -->
<!-- div class="buy-now">
<a
href="https://themeselection.com/products/sneat-bootstrap-html-admin-template/"
target="_blank"
class="btn btn-danger btn-buy-now"
>Change language</a
>
</div -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>