mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Remove the old login page
This commit is contained in:
parent
b5821b0d02
commit
b322b514fc
@ -1,90 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Kyoo - Login</title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="lib/bootstrap.min.css" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="login.css" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="material-icons.css" />
|
|
||||||
<script src="lib/jquery.min.js"></script>
|
|
||||||
<script src="lib/bootstrap.min.js"></script>
|
|
||||||
</head>
|
|
||||||
<body style="height: 100vh; align-items: center;" class="d-flex">
|
|
||||||
<div class="container pb-5">
|
|
||||||
<div class="card bg-dark mb-5">
|
|
||||||
<div class="card-header bg-secondary text-white">
|
|
||||||
<ul class="nav nav-tabs card-header-tabs navbar-dark" role="tablist" id="tabs">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" id="login-tab" data-toggle="tab" href="#login" role="tab" aria-selected="true">Login</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#register" role="tab" aria-selected="false">Register</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="card-body tab-content">
|
|
||||||
<div class="tab-pane fade show active" id="login" role="tabpanel" aria-labelledby="login-tab">
|
|
||||||
<div class="alert alert-danger" role="alert" id="login-error" style="display: none;"></div>
|
|
||||||
<form>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="login-username">Username</label>
|
|
||||||
<input autocomplete="username" class="form-control" id="login-username">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="login-password">Password</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input autocomplete="current-password" type="password" class="form-control" id="login-password">
|
|
||||||
<div class="input-group-append password-visibility">
|
|
||||||
<a class="input-group-text" href="#"><i class="material-icons">visibility</i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group form-check">
|
|
||||||
<input type="checkbox" class="form-check-input" id="remember-me">
|
|
||||||
<label class="form-check-label" for="remember-me">Remember me</label>
|
|
||||||
</div>
|
|
||||||
<button id="login-btn" type="submit" class="btn" style="background-color: #e23c00;">Login</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane fade" id="register" role="tabpanel" aria-labelledby="register-tab">
|
|
||||||
<div class="alert alert-danger" role="alert" id="register-error" style="display: none;"></div>
|
|
||||||
<form>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="register-email">Email</label>
|
|
||||||
<input type="email" class="form-control" id="register-email">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="register-username">Username</label>
|
|
||||||
<input autocomplete="username" class="form-control" id="register-username">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="register-password">Password</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input autocomplete="new-password" type="password" class="form-control" id="register-password">
|
|
||||||
<div class="input-group-append password-visibility">
|
|
||||||
<a class="input-group-text" href="#"><i class="material-icons">visibility</i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="register-password-confirm">Confirm Password</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input autocomplete="new-password" type="password" class="form-control" id="register-password-confirm">
|
|
||||||
<div class="input-group-append password-visibility">
|
|
||||||
<a class="input-group-text" href="#"><i class="material-icons">visibility</i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group form-check">
|
|
||||||
<input type="checkbox" class="form-check-input" id="stay-logged-in">
|
|
||||||
<label class="form-check-label" for="stay-logged-in">Stay logged in</label>
|
|
||||||
</div>
|
|
||||||
<button id="register-btn" type="submit" class="btn" style="background-color: #e23c00;">Register</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="login.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
1
src/Kyoo.WebLogin/lib/bootstrap.min.css
vendored
1
src/Kyoo.WebLogin/lib/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
7
src/Kyoo.WebLogin/lib/bootstrap.min.js
vendored
7
src/Kyoo.WebLogin/lib/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
src/Kyoo.WebLogin/lib/jquery.min.js
vendored
2
src/Kyoo.WebLogin/lib/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,16 +0,0 @@
|
|||||||
.nav-tabs .nav-link, a
|
|
||||||
{
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active
|
|
||||||
{
|
|
||||||
background-color: #343a40;
|
|
||||||
color: white;
|
|
||||||
border-color: #343a40;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-control:focus
|
|
||||||
{
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
@ -1,127 +0,0 @@
|
|||||||
$("#tabs a").on("click", function (e)
|
|
||||||
{
|
|
||||||
e.preventDefault();
|
|
||||||
$(this).tab("show");
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".password-visibility a").on("click", function(e)
|
|
||||||
{
|
|
||||||
e.preventDefault();
|
|
||||||
let password = $(this).parent().siblings("input");
|
|
||||||
let toggle = $(this).children("i");
|
|
||||||
|
|
||||||
if (password.attr("type") === "text")
|
|
||||||
{
|
|
||||||
password.attr("type", "password");
|
|
||||||
toggle.text("visibility");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
toggle.text("visibility_off");
|
|
||||||
password.attr("type", "text");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#login-btn").on("click", function (e)
|
|
||||||
{
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
let user = {
|
|
||||||
username: $("#login-username")[0].value,
|
|
||||||
password: $("#login-password")[0].value,
|
|
||||||
stayLoggedIn: $("#remember-me")[0].checked
|
|
||||||
};
|
|
||||||
|
|
||||||
$.ajax(
|
|
||||||
{
|
|
||||||
url: "/api/account/login",
|
|
||||||
type: "POST",
|
|
||||||
contentType: 'application/json;charset=UTF-8',
|
|
||||||
data: JSON.stringify(user),
|
|
||||||
success: function ()
|
|
||||||
{
|
|
||||||
let returnUrl = new URLSearchParams(window.location.search).get("ReturnUrl");
|
|
||||||
|
|
||||||
if (returnUrl == null)
|
|
||||||
window.location.href = "/unauthorized";
|
|
||||||
else
|
|
||||||
window.location.href = returnUrl;
|
|
||||||
},
|
|
||||||
error: function(xhr)
|
|
||||||
{
|
|
||||||
let error = $("#login-error");
|
|
||||||
error.show();
|
|
||||||
error.text(JSON.parse(xhr.responseText)[0].description);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#register-btn").on("click", function (e)
|
|
||||||
{
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
let user = {
|
|
||||||
email: $("#register-email")[0].value,
|
|
||||||
username: $("#register-username")[0].value,
|
|
||||||
password: $("#register-password")[0].value
|
|
||||||
};
|
|
||||||
|
|
||||||
if (user.password !== $("#register-password-confirm")[0].value)
|
|
||||||
{
|
|
||||||
let error = $("#register-error");
|
|
||||||
error.show();
|
|
||||||
error.text("Passwords don't match.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$.ajax(
|
|
||||||
{
|
|
||||||
url: "/api/account/register",
|
|
||||||
type: "POST",
|
|
||||||
contentType: 'application/json;charset=UTF-8',
|
|
||||||
dataType: 'json',
|
|
||||||
data: JSON.stringify(user),
|
|
||||||
success: function(res)
|
|
||||||
{
|
|
||||||
useOtac(res.otac);
|
|
||||||
},
|
|
||||||
error: function(xhr)
|
|
||||||
{
|
|
||||||
let error = $("#register-error");
|
|
||||||
error.show();
|
|
||||||
error.html(Object.values(JSON.parse(xhr.responseText).errors).map(x => x[0]).join("<br/>"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function useOtac(otac)
|
|
||||||
{
|
|
||||||
$.ajax(
|
|
||||||
{
|
|
||||||
url: "/api/account/otac-login",
|
|
||||||
type: "POST",
|
|
||||||
contentType: 'application/json;charset=UTF-8',
|
|
||||||
data: JSON.stringify({otac: otac, stayLoggedIn: $("#stay-logged-in")[0].checked}),
|
|
||||||
success: function()
|
|
||||||
{
|
|
||||||
let returnUrl = new URLSearchParams(window.location.search).get("ReturnUrl");
|
|
||||||
|
|
||||||
if (returnUrl == null)
|
|
||||||
window.location.href = "/unauthorized";
|
|
||||||
else
|
|
||||||
window.location.href = returnUrl;
|
|
||||||
},
|
|
||||||
error: function(xhr)
|
|
||||||
{
|
|
||||||
let error = $("#register-error");
|
|
||||||
error.show();
|
|
||||||
error.text(JSON.parse(xhr.responseText)[0].description);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let otac = new URLSearchParams(window.location.search).get("otac");
|
|
||||||
if (otac != null)
|
|
||||||
useOtac(otac);
|
|
@ -1,36 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: 'Material Icons';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: url(/iconfont/MaterialIcons-Regular.eot); /* For IE6-8 */
|
|
||||||
src: local('Material Icons'),
|
|
||||||
local('MaterialIcons-Regular'),
|
|
||||||
url(/iconfont/MaterialIcons-Regular.woff2) format('woff2'),
|
|
||||||
url(/iconfont/MaterialIcons-Regular.woff) format('woff'),
|
|
||||||
url(/iconfont/MaterialIcons-Regular.ttf) format('truetype');
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-icons {
|
|
||||||
font-family: 'Material Icons';
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 24px; /* Preferred icon size */
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 1;
|
|
||||||
text-transform: none;
|
|
||||||
letter-spacing: normal;
|
|
||||||
word-wrap: normal;
|
|
||||||
white-space: nowrap;
|
|
||||||
direction: ltr;
|
|
||||||
|
|
||||||
/* Support for all WebKit browsers. */
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
/* Support for Safari and Chrome. */
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
|
|
||||||
/* Support for Firefox. */
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
|
|
||||||
/* Support for IE. */
|
|
||||||
font-feature-settings: 'liga';
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user