mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-10 17:24:39 +00:00
Complete implementation of http authentication, fixes #19
This commit is contained in:
parent
7ef855a297
commit
f877928354
58
app/components/login/login.css
Normal file
58
app/components/login/login.css
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
label, input {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-family: Verdana, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
-webkit-app-region: drag;
|
||||||
|
}
|
||||||
|
.login-form {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form > div {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form > div > label {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
letter-spacing: 5px;
|
||||||
|
font-weight: 100;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 18px;
|
||||||
|
text-align: center;
|
||||||
|
color: rgba(0, 0, 0, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form > div > input {
|
||||||
|
height: 30px;
|
||||||
|
width: 225px;
|
||||||
|
font-size: 16px;
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form > div > button {
|
||||||
|
border: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 100;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin-top: 20px;
|
||||||
|
height: 35px;
|
||||||
|
width: 225px;
|
||||||
|
background-color: #2196F3;
|
||||||
|
color: white;
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: #0D47A1;
|
||||||
|
}
|
@ -3,19 +3,20 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Login</title>
|
<title>Login</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="login.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form id="login-form">
|
<form class="login-form" id="login-form">
|
||||||
<div>
|
<div>
|
||||||
<label for="username-input">Username:</label>
|
<label for="username-input">Username</label>
|
||||||
<input type="text" id="username-input"/>
|
<input type="text" id="username-input"/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="password-input">Password:</label>
|
<label for="password-input">Password</label>
|
||||||
<input type="password" id="password-input"/>
|
<input type="password" id="password-input"/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button id="submit-form-button" type="submit">Send your message</button>
|
<button id="submit-form-button" type="submit">Login</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script src="login.js"></script>
|
<script src="login.js"></script>
|
||||||
|
@ -104,7 +104,12 @@ app.on('ready', function () {
|
|||||||
|
|
||||||
app.on('login', function(event, webContents, request, authInfo, callback) {
|
app.on('login', function(event, webContents, request, authInfo, callback) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var loginWindow = new BrowserWindow();
|
var loginWindow = new BrowserWindow({
|
||||||
|
width: 300,
|
||||||
|
height: 400,
|
||||||
|
frame: false,
|
||||||
|
resizable: false
|
||||||
|
});
|
||||||
loginWindow.loadURL('file://' + __dirname + '/components/login/login.html');
|
loginWindow.loadURL('file://' + __dirname + '/components/login/login.html');
|
||||||
|
|
||||||
ipcMain.once('login-message', function(event, usernameAndPassword) {
|
ipcMain.once('login-message', function(event, usernameAndPassword) {
|
||||||
|
Loading…
Reference in New Issue
Block a user