Genesis commit
No files matched your search
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"bip32": {
|
||||
"serverExtendedPrivateKey": "xprivgeneratebyyourservicespecificallytorunonthisserver",
|
||||
"serverExtendedPrivateKeyDerivationPath": "a/123/456/789", // Doesn't support hardned keys?
|
||||
"serviceAuthenticatingExtendedPublicKey": "xpubfortheservicewhichownsthisandwhichclientscanusetoauthenticateserviceownedresources"
|
||||
},
|
||||
"bcrypt" : {
|
||||
"salt" : 9
|
||||
},
|
||||
"database" : {
|
||||
"dialect" : "sqlite",
|
||||
"host" : "localhost",
|
||||
"database" : "databases",
|
||||
"username" : "databases",
|
||||
"password" : "sdaabasfd",
|
||||
"storage" : "database.sqlite",
|
||||
"define": {
|
||||
"paranoid": true
|
||||
},
|
||||
"logging": false
|
||||
// Encryption on database...
|
||||
// "dialectOptions": {
|
||||
// "encrypt": true
|
||||
// }
|
||||
},
|
||||
"server" : {
|
||||
"secret" : "don't forget to keep your secrets secret",
|
||||
"port" : 8765,
|
||||
"cookie": {
|
||||
// "domain": ".sigidli.com"
|
||||
},
|
||||
"compiled-render": false,
|
||||
"domain": "example.org"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
var config = require("config");
|
||||
|
||||
var server = require('./server/server.js')();
|
||||
var persistence = require('./persistence/persistence.js')(config);
|
||||
|
||||
// server.run(config, db);
|
||||
persistence.LoadDB().then(db => {
|
||||
console.log("Loaded DB.");
|
||||
return server.run(db);
|
||||
}).then((port) => {
|
||||
console.log("Server is running on: ", port);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Failed to run server: ", error);
|
||||
var errors = error;
|
||||
})
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "auth.sigidli.com",
|
||||
"version": "0.0.1",
|
||||
"description": "Site showing how hierarchically deterministic assymetric cryptographic keys can be used for authentication purposes.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [
|
||||
"hierarchically",
|
||||
"deterministic"
|
||||
],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bcrypt": "^3.0.6",
|
||||
"body-parser": "^1.19.0",
|
||||
"config": "^3.2.3",
|
||||
"connect-session-sequelize": "^6.0.0",
|
||||
"express": "^4.17.1",
|
||||
"express-session": "^1.17.0",
|
||||
"moment": "^2.24.0",
|
||||
"nanoid": "^2.1.6",
|
||||
"passport": "^0.4.0",
|
||||
"passport-local": "^1.0.0",
|
||||
"pug": "^2.0.4",
|
||||
"qrcode": "^1.4.4",
|
||||
"sequelize": "^5.21.1",
|
||||
"sqlite3": "^4.1.0",
|
||||
"tunnel-ssh": "^4.1.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("authenticationMethod", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
method: {
|
||||
type: DataTypes.ENUM,
|
||||
values: ['hd-auth', 'password', 'google-oauth']
|
||||
},
|
||||
order: {
|
||||
type: DataTypes.INTEGER,
|
||||
defaultValue: function() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
comment: "The supported authentication methods for a user of the system."
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("extendedPublicKey", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
xpub: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
}
|
||||
}, {
|
||||
comment: "Extended Public Key belonging to the users of the system"
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
const bcrypt = require('bcrypt');
|
||||
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("password", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
password: {
|
||||
type: DataTypes.STRING,
|
||||
// primaryKey: true,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
set(val) {
|
||||
var hashedPassword = options != null && val != null && val.length > 0 ?
|
||||
bcrypt.hashSync(val, bcrypt.genSaltSync(11)) :
|
||||
null
|
||||
;
|
||||
this.setDataValue('password', hashedPassword);
|
||||
}
|
||||
// should have an accessor method the redacts this failed...
|
||||
}
|
||||
}, {
|
||||
comment: "hashed password"
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
var model = sequelize.define("session", {
|
||||
sid: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
unique: true,
|
||||
},
|
||||
expires: DataTypes.DATE,
|
||||
data: DataTypes.STRING(50000)
|
||||
}, {
|
||||
comment: "Each session in the system will be stored in this table..."
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("user", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
|
||||
displayName: {
|
||||
type: DataTypes.STRING,
|
||||
// allowNull: false
|
||||
}
|
||||
}, {
|
||||
comment: "The individual users of the system..."
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.Sessions = model.hasMany(db.Session);
|
||||
model.ExtendedPublicKeys = model.hasMany(db.ExtendedPublicKey);
|
||||
model.Passwords = model.hasMany(db.Password);
|
||||
model.AuthenticationMethods = model.hasMany(db.AuthenticationMethod);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
@@ -0,0 +1,128 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function () {
|
||||
var db = {};
|
||||
|
||||
const config = require('config');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const nanoid = require('nanoid');
|
||||
const tunnel = require('tunnel-ssh');
|
||||
|
||||
var dbOptions = {
|
||||
db: db,
|
||||
moment: require('moment'),
|
||||
generateUniqueId: (customIdSize) => {
|
||||
var idSize = customIdSize || 11;
|
||||
return nanoid(idSize); //=> "hsCc0ocrXkc"
|
||||
}
|
||||
};
|
||||
|
||||
dbOptions.Sequelize = require('sequelize');
|
||||
dbOptions.bcrypt = require('bcrypt');
|
||||
|
||||
dbOptions.sequelize = new dbOptions.Sequelize(config.get('database'));
|
||||
|
||||
// Load all the models...
|
||||
var modelDir = path.join(__dirname, './models/');
|
||||
fs.readdirSync(modelDir)
|
||||
.filter(file => {
|
||||
return (file.indexOf('.') !== 0) && (file !== "index.js") && (file.slice(-3) === '.js');
|
||||
})
|
||||
.forEach(file => {
|
||||
// const model = sequelize['import'](path.join(modelDir, file));
|
||||
const model = require(path.join(modelDir, file))(dbOptions.sequelize, dbOptions.Sequelize, dbOptions);
|
||||
|
||||
// Format the Model Name like we have for this project...
|
||||
var modelName = model.name;
|
||||
modelName = modelName.replace(modelName[0], modelName[0].toUpperCase());
|
||||
|
||||
// Add model to the db...
|
||||
db[modelName] = model;
|
||||
});
|
||||
|
||||
// Time for the associations...
|
||||
|
||||
Object.keys(db).forEach(modelName => {
|
||||
if (db[modelName].associate) {
|
||||
console.log("Loading associations for " + modelName);
|
||||
db[modelName].associate(db);
|
||||
}
|
||||
});
|
||||
|
||||
db.LoadDB = () => {
|
||||
db.Sequelize = dbOptions.Sequelize;
|
||||
db.sequelize = dbOptions.sequelize;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
tunneling()
|
||||
.then(() => {
|
||||
return dbOptions.sequelize.sync()
|
||||
}).then(() => {
|
||||
resolve(db);
|
||||
}).catch(error => {
|
||||
// Do the things...
|
||||
reject(error);
|
||||
console.error('Unable to connect to the database:', error);
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
db.updateDatabaseFromModels = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
dbOptions.sequelize.sync({
|
||||
alter: true
|
||||
})
|
||||
.then(() => {
|
||||
resolve(true);
|
||||
console.log("DB update successful.");
|
||||
})
|
||||
.catch(error => {
|
||||
// Do the things...
|
||||
reject(error);
|
||||
console.error('Unable to connect to the database:', error);
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
var tunneling = () => {
|
||||
const tunnelConfigs = config.get("tunnel");
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
if(tunnelConfigs.useTunnel) {
|
||||
const privateKeyFilePath = path.resolve(tunnelConfigs["privateKeyFilePath"]);
|
||||
// Run the tunnel...
|
||||
var sshConfig = {
|
||||
"keepAlive": tunnelConfigs["keepAlive"],
|
||||
"username": tunnelConfigs["username"],
|
||||
// "password": tunnelConfigs["password"],
|
||||
"host": tunnelConfigs["host"],
|
||||
"port": tunnelConfigs["port"],
|
||||
"dstHost": tunnelConfigs["dstHost"],
|
||||
"dstPort": tunnelConfigs["dstPort"],
|
||||
// "localHost": tunnelConfigs["localHost"],
|
||||
"localPort": tunnelConfigs["localPort"],
|
||||
"privateKey": fs.readFileSync(privateKeyFilePath),
|
||||
"passphrase": tunnelConfigs["passphrase"]
|
||||
}
|
||||
console.log("Private Key path: ", privateKeyFilePath);
|
||||
tunnel(sshConfig, (error, server) => {
|
||||
if(error) {
|
||||
console.error("Tunneling: ", error);
|
||||
reject(error);
|
||||
} else {
|
||||
console.log('Tunnel server:', server);
|
||||
resolve(server)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// Continue without setting up a tunnel...
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
}
|
||||
return db;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
/**
|
||||
* This router handles things related to the web browser experience...
|
||||
*/
|
||||
// This is the mock data we working with...
|
||||
|
||||
module.exports = function (options) {
|
||||
const config = require('config');
|
||||
var QRCode = require('qrcode');
|
||||
var express = options.express;
|
||||
|
||||
const db = options.db;
|
||||
const hdAuthUtil = options.hdAuthUtil;
|
||||
|
||||
var router = express.Router();
|
||||
|
||||
router.route('/')
|
||||
.get(function(request, response, next) {
|
||||
response.render("home", {
|
||||
user: request.user,
|
||||
pageTitle: "HDAuth - Account"
|
||||
})
|
||||
});
|
||||
|
||||
router.route('/authenticate')
|
||||
.get(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
response.render("login-displayName", {
|
||||
user: request.user,
|
||||
pageTitle: "HDAuth - Login"
|
||||
})
|
||||
}
|
||||
})
|
||||
.post(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
db.User.findOne({
|
||||
where: {
|
||||
displayName: request.body.displayName
|
||||
},
|
||||
include: [
|
||||
{
|
||||
association: db.User.ExtendedPublicKeys,
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}).then(user => {
|
||||
if(user) {
|
||||
// TODO: Support multiple login options...
|
||||
const loginMessage = {
|
||||
userIdentifier: user.displayName,
|
||||
domainUrl: "sigidli.com" // TODO: Replace with config value...
|
||||
}
|
||||
const challenge = hdAuthUtil.createChallenge(
|
||||
user.extendedPublicKeys[0].xpub,
|
||||
JSON.stringify(loginMessage) // TODO: Create a login body...
|
||||
)
|
||||
QRCode.toDataURL(JSON.stringify(challenge), function (err, url) {
|
||||
if(err) {
|
||||
console.error(err);
|
||||
}
|
||||
response.render("xpub-login", {
|
||||
// challenge user to sign thier xpub
|
||||
challenge: challenge,
|
||||
qrCode: url,
|
||||
user: request.user
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// User doesn't exist register account
|
||||
response.render("login-signup", {
|
||||
user: request.user,
|
||||
displayName: request.body.displayName,
|
||||
pageTitle: "HD Auth - Signup",
|
||||
});
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
console.error("Failed to fulfill account/authenticate post", request.body);
|
||||
console.error("Reason: ", error);
|
||||
|
||||
response.render("error", {
|
||||
message: "This site didn't have the time for error handling."
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
router.route('/authenticate/response')
|
||||
.post(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
// Verify challenge
|
||||
if(hdAuthUtil.verifyHDAuthChallengeResponse(request.body)) {
|
||||
// user passed challenge...
|
||||
var loginMessage = JSON.parse(request.body.message);
|
||||
db.User.findOne({
|
||||
where: {
|
||||
displayName: loginMessage.userIdentifier,
|
||||
},
|
||||
include: [
|
||||
{
|
||||
association: db.User.ExtendedPublicKeys
|
||||
}
|
||||
]
|
||||
}).then(user => {
|
||||
if(user) {
|
||||
// User created we can authenticate them on the site...
|
||||
request.logIn(user, function(err) {
|
||||
if (err) { return next(err); }
|
||||
return response.redirect('/');
|
||||
});
|
||||
} else {
|
||||
console.error("Authenticated user doesn't exist: ", loginMessage);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("Failed to create authenticated user");
|
||||
console.error("Error: ", error);
|
||||
next(error);
|
||||
})
|
||||
} else {
|
||||
// user failed challenge
|
||||
console.error("User failed to authenticate");
|
||||
// Create new challenge and try again...
|
||||
return response.redirect('/authenticate');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
router.route('/register')
|
||||
.get(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
response.render("account-registration", {
|
||||
user: request.user,
|
||||
newUser: {},
|
||||
pageTitle: "HDAuth - Registration"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
router.route('/register/xpub')
|
||||
.post(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
db.User.build({
|
||||
displayName: request.body.displayName,
|
||||
extendedPublicKeys: [
|
||||
{
|
||||
xpub: request.body.xpub
|
||||
}
|
||||
]
|
||||
}, {
|
||||
include: [
|
||||
{
|
||||
association: db.User.ExtendedPublicKeys
|
||||
}
|
||||
]
|
||||
}).validate()
|
||||
.then(xpubUser => {
|
||||
if (xpubUser) {
|
||||
// Challenge
|
||||
const registerationMessage = {
|
||||
userIdentifier: xpubUser.displayName, // identifier the user supplies on the login page
|
||||
user: xpubUser,
|
||||
serviceExtendedPublicKey: config.get("bip32.serviceAuthenticatingExtendedPublicKey"),
|
||||
url: "sigidli.com"
|
||||
}
|
||||
const challenge = hdAuthUtil.createChallenge(
|
||||
request.body.xpub, // update this to identifier...
|
||||
JSON.stringify(registerationMessage)
|
||||
)
|
||||
QRCode.toDataURL(JSON.stringify(challenge), function (err, url) {
|
||||
if(err) {
|
||||
console.error(err);
|
||||
}
|
||||
response.render("xpub-account-registeration-challenge", {
|
||||
xpubUser: xpubUser,
|
||||
// challenge user to sign thier xpub
|
||||
challenge: challenge,
|
||||
qrCode: url,
|
||||
user: request.user
|
||||
})
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log("Empty User")
|
||||
|
||||
// TODO: error handling..
|
||||
response.render("error", {
|
||||
user: request.user,
|
||||
message: "VOID"
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("Failed to create user");
|
||||
console.error("Reason: ", error);
|
||||
|
||||
// TODO: error handling..
|
||||
response.render("error", {
|
||||
user: request.user,
|
||||
message: "Failed to create user"
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
router.route('/register/xpub/response')
|
||||
.post(function(request, response, next) {
|
||||
if(request.user) {
|
||||
response.redirect('/account');
|
||||
} else {
|
||||
// Verify challenge
|
||||
if(hdAuthUtil.verifyHDAuthChallengeResponse(request.body)) {
|
||||
// user passed challenge...
|
||||
// TODO: Load registration request from challenge.message
|
||||
// TODO: build and validate that user owns xpub...
|
||||
var xpubUser = JSON.parse(request.body.message).user;
|
||||
// Possibility that username is taken...
|
||||
// TODO: Create user without username
|
||||
db.User.create(xpubUser, {
|
||||
include: [
|
||||
{
|
||||
association: db.User.ExtendedPublicKeys
|
||||
}
|
||||
]
|
||||
}).then(user => {
|
||||
if(user) {
|
||||
// User created we can authenticate them on the site...
|
||||
request.logIn(user, function(err) {
|
||||
if (err) { return next(err); }
|
||||
return response.redirect('/');
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("Failed to create authenticated user");
|
||||
console.error("Error: ", error);
|
||||
next(error);
|
||||
})
|
||||
} else {
|
||||
// user failed challenge
|
||||
// TODO: Validate input
|
||||
// TODO: Createa new challenge
|
||||
console.error("User failed to authenticate");
|
||||
// Create new challenge and try again...
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
router.route('/logout')
|
||||
.post(function(request, response, next) {
|
||||
if(request.user) {
|
||||
request.logout();
|
||||
response.redirect('/');
|
||||
|
||||
// db.Session.destroy({
|
||||
// where: {
|
||||
// sid: request.sessionID
|
||||
// }
|
||||
// }).then(() => {
|
||||
// console.log("")
|
||||
// }).catch(error => {
|
||||
// next(error);
|
||||
// console.error("Log out error: ", error);
|
||||
// })
|
||||
} else {
|
||||
// No user...
|
||||
response.redirect('/');
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: add other endpoints
|
||||
return router;
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* This router handles things related to the web browser experience...
|
||||
*/
|
||||
// This is the mock data we working with...
|
||||
|
||||
module.exports = function (options) {
|
||||
|
||||
var express = options.express;
|
||||
|
||||
const db = options.db;
|
||||
|
||||
var router = express.Router();
|
||||
|
||||
router.route('/')
|
||||
.get(function(request, response, next) {
|
||||
response.render("home", {
|
||||
user: request.user,
|
||||
pageTitle: "HDAuth - Home"
|
||||
})
|
||||
});
|
||||
|
||||
// TODO: load child routers automatically
|
||||
var accountRouter = require('./account/index.js')(options);
|
||||
|
||||
router.use('/account', accountRouter);
|
||||
|
||||
return router;
|
||||
};
|
||||
@@ -0,0 +1,119 @@
|
||||
module.exports = function () {
|
||||
var server = {};
|
||||
|
||||
server.run = (db) => {
|
||||
console.log("Starting Server")
|
||||
return new Promise((resolve, reject) => {
|
||||
const config = require('config');
|
||||
const express = require('express');
|
||||
const pug = require("pug");
|
||||
const session = require("express-session");
|
||||
const SequelizeSessionStore = require('connect-session-sequelize')(session.Store);
|
||||
const bodyParser = require("body-parser");
|
||||
const path = require("path");
|
||||
|
||||
const passport = require('passport');
|
||||
const HDAuthStrategy = require('../../passport-hd-auth').Strategy;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.set("view engine", "pug");
|
||||
app.set("views", path.resolve("server/views"));
|
||||
|
||||
app.use('/static', express.static("server/static"));
|
||||
|
||||
// Session related stuff...
|
||||
function extendDefaultFields(defaults, session) {
|
||||
return {
|
||||
data: defaults.data,
|
||||
expires: session.cookie && session.cookie.expires ? session.cookie.expires : defaults.expires, // 157680000
|
||||
userId: session.passport.user
|
||||
};
|
||||
}
|
||||
|
||||
var sessionStore = new SequelizeSessionStore({
|
||||
db: db.sequelize,
|
||||
table: 'session',
|
||||
extendDefaultFields: extendDefaultFields
|
||||
// TODO: Define expiry and clean up...
|
||||
});
|
||||
|
||||
app.use(session({
|
||||
store: sessionStore,
|
||||
secret: config.get("server.secret"),
|
||||
saveUninitialized: false,
|
||||
cookie: config.get("server.cookie")
|
||||
}));
|
||||
sessionStore.sync();
|
||||
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use(bodyParser.json());
|
||||
|
||||
// Setup all passport strategies
|
||||
const hdAuthUtil = new HDAuthStrategy({
|
||||
serverExtendedPrivateKey: config.get('bip32.serverExtendedPrivateKey'),
|
||||
serverExtendedPrivateKeyDerivationPath: config.get('bip32.serverExtendedPrivateKeyDerivationPath'),
|
||||
serviceAuthenticatingExtendedPublicKey: config.get('bip32.serviceAuthenticatingExtendedPublicKey')
|
||||
}, function(xpub, challengeRequestDerivationPath, challengeRequestMessage, challengeResponseSignature, done) {
|
||||
db.User.findOne({
|
||||
include: [
|
||||
{
|
||||
association: db.User.ExtendedPublicKeys,
|
||||
required: true,
|
||||
where: {
|
||||
xpub: xpub
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(user => {
|
||||
if(user) {
|
||||
done(null, user, {verified: true})
|
||||
} else {
|
||||
done(null, false);
|
||||
}
|
||||
}).catch(error => {
|
||||
done(error);
|
||||
})
|
||||
});
|
||||
passport.use(hdAuthUtil); // TODO: implement new hdAuthUtil.Strategy()
|
||||
|
||||
passport.serializeUser(function(user, done) {
|
||||
done(null, user.id);
|
||||
});
|
||||
|
||||
passport.deserializeUser(function(id, done) {
|
||||
// TODO: Add memberships and things like that...
|
||||
return db.User.findByPk(id) // TODO: Limit attributes...
|
||||
.then(user => {
|
||||
return done(null, user);
|
||||
}).catch(error => {
|
||||
return done(error);
|
||||
})
|
||||
});
|
||||
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
|
||||
// TODO: Create a load router module... that has inheritence...
|
||||
var router = require('./router/index.js')({
|
||||
app: app,
|
||||
express: express,
|
||||
db: db,
|
||||
passport: passport,
|
||||
hdAuthUtil: hdAuthUtil
|
||||
});
|
||||
// REGISTER OUR ROUTES -------------------------------
|
||||
// all of our routes will be prefixed with /api
|
||||
app.use('/', router);
|
||||
|
||||
const port = process.env.PORT || config.get("server.port");
|
||||
|
||||
app.listen(port);
|
||||
resolve(port);
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: other features I might wanna do in the server...
|
||||
|
||||
return server;
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
.row
|
||||
.col.s12
|
||||
h4 HD Auth Account Registration
|
||||
.row
|
||||
.col.s12.m1
|
||||
.col.s12.m10
|
||||
if error && error.message
|
||||
.row
|
||||
.col.s12
|
||||
p.flow-text.red-text= error.message
|
||||
//- img.materialboxed(width="100%", src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Wikidata_logo_under_construction_sign_diamond.svg/1920px-Wikidata_logo_under_construction_sign_diamond.svg.png", alt="Under Construction")
|
||||
form(method="post")
|
||||
//- input(type="hidden", name="email", value=email)
|
||||
.row.center
|
||||
.input-field.col.s12.m6
|
||||
input(name="displayName", type="text", value=newUser.displayName, placeholder="Unique displayName", autofocus)
|
||||
label(for="displayName") Display Name
|
||||
.input-field.col.s12.m6
|
||||
input(name="email", value=newUser.email, placeholder="email useful for account recovery", type="text")
|
||||
label(for="email") Optional email
|
||||
.row
|
||||
|
||||
.col.s12
|
||||
ul.tabs
|
||||
li.tab.col.s6
|
||||
a.active(href="#xpub-tab") with Extended Public Key
|
||||
li.tab.col.s6
|
||||
a(href="#password-tab") with Password
|
||||
#xpub-tab.col.s12
|
||||
.row
|
||||
.row
|
||||
.input-field.col.s12
|
||||
input(name="xpub", type="text", placeholder="Extended Public")
|
||||
label(for="xpub") Extended Public Key
|
||||
//- TODO: Challenge to sign the xpub...
|
||||
.row.center
|
||||
.col.s12
|
||||
button.btn(type="submit", formaction="/account/register/xpub") Register with Extended Public Key
|
||||
#password-tab.col.s12
|
||||
.row
|
||||
.row
|
||||
.input-field.col.s12.m6
|
||||
input(name="password", type="password", placeholder="Unique password")
|
||||
label(for="password") Password
|
||||
.input-field.col.s12.m6
|
||||
input(name="confirmPassword", type="password", placeholder="Confirm your unique password")
|
||||
label(for="confirmPassword") Confirm Password
|
||||
.row.center
|
||||
.col.s12
|
||||
button.btn(type="submit", formaction="/account/register/password") Register with Password
|
||||
.col.s12.m1
|
||||
@@ -0,0 +1,31 @@
|
||||
/*!
|
||||
* Materialize v1.0.0 (http://materializecss.com)
|
||||
* Copyright 2014-2017 Materialize
|
||||
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
|
||||
*/
|
||||
.materialize-red{background-color:#e51c23 !important}.materialize-red-text{color:#e51c23 !important}.materialize-red.lighten-5{background-color:#fdeaeb !important}.materialize-red-text.text-lighten-5{color:#fdeaeb !important}.materialize-red.lighten-4{background-color:#f8c1c3 !important}.materialize-red-text.text-lighten-4{color:#f8c1c3 !important}.materialize-red.lighten-3{background-color:#f3989b !important}.materialize-red-text.text-lighten-3{color:#f3989b !important}.materialize-red.lighten-2{background-color:#ee6e73 !important}.materialize-red-text.text-lighten-2{color:#ee6e73 !important}.materialize-red.lighten-1{background-color:#ea454b !important}.materialize-red-text.text-lighten-1{color:#ea454b !important}.materialize-red.darken-1{background-color:#d0181e !important}.materialize-red-text.text-darken-1{color:#d0181e !important}.materialize-red.darken-2{background-color:#b9151b !important}.materialize-red-text.text-darken-2{color:#b9151b !important}.materialize-red.darken-3{background-color:#a21318 !important}.materialize-red-text.text-darken-3{color:#a21318 !important}.materialize-red.darken-4{background-color:#8b1014 !important}.materialize-red-text.text-darken-4{color:#8b1014 !important}.red{background-color:#F44336 !important}.red-text{color:#F44336 !important}.red.lighten-5{background-color:#FFEBEE !important}.red-text.text-lighten-5{color:#FFEBEE !important}.red.lighten-4{background-color:#FFCDD2 !important}.red-text.text-lighten-4{color:#FFCDD2 !important}.red.lighten-3{background-color:#EF9A9A !important}.red-text.text-lighten-3{color:#EF9A9A !important}.red.lighten-2{background-color:#E57373 !important}.red-text.text-lighten-2{color:#E57373 !important}.red.lighten-1{background-color:#EF5350 !important}.red-text.text-lighten-1{color:#EF5350 !important}.red.darken-1{background-color:#E53935 !important}.red-text.text-darken-1{color:#E53935 !important}.red.darken-2{background-color:#D32F2F !important}.red-text.text-darken-2{color:#D32F2F !important}.red.darken-3{background-color:#C62828 !important}.red-text.text-darken-3{color:#C62828 !important}.red.darken-4{background-color:#B71C1C !important}.red-text.text-darken-4{color:#B71C1C !important}.red.accent-1{background-color:#FF8A80 !important}.red-text.text-accent-1{color:#FF8A80 !important}.red.accent-2{background-color:#FF5252 !important}.red-text.text-accent-2{color:#FF5252 !important}.red.accent-3{background-color:#FF1744 !important}.red-text.text-accent-3{color:#FF1744 !important}.red.accent-4{background-color:#D50000 !important}.red-text.text-accent-4{color:#D50000 !important}.pink{background-color:#e91e63 !important}.pink-text{color:#e91e63 !important}.pink.lighten-5{background-color:#fce4ec !important}.pink-text.text-lighten-5{color:#fce4ec !important}.pink.lighten-4{background-color:#f8bbd0 !important}.pink-text.text-lighten-4{color:#f8bbd0 !important}.pink.lighten-3{background-color:#f48fb1 !important}.pink-text.text-lighten-3{color:#f48fb1 !important}.pink.lighten-2{background-color:#f06292 !important}.pink-text.text-lighten-2{color:#f06292 !important}.pink.lighten-1{background-color:#ec407a !important}.pink-text.text-lighten-1{color:#ec407a !important}.pink.darken-1{background-color:#d81b60 !important}.pink-text.text-darken-1{color:#d81b60 !important}.pink.darken-2{background-color:#c2185b !important}.pink-text.text-darken-2{color:#c2185b !important}.pink.darken-3{background-color:#ad1457 !important}.pink-text.text-darken-3{color:#ad1457 !important}.pink.darken-4{background-color:#880e4f !important}.pink-text.text-darken-4{color:#880e4f !important}.pink.accent-1{background-color:#ff80ab !important}.pink-text.text-accent-1{color:#ff80ab !important}.pink.accent-2{background-color:#ff4081 !important}.pink-text.text-accent-2{color:#ff4081 !important}.pink.accent-3{background-color:#f50057 !important}.pink-text.text-accent-3{color:#f50057 !important}.pink.accent-4{background-color:#c51162 !important}.pink-text.text-accent-4{color:#c51162 !important}.purple{background-color:#9c27b0 !important}.purple-text{color:#9c27b0 !important}.purple.lighten-5{background-color:#f3e5f5 !important}.purple-text.text-lighten-5{color:#f3e5f5 !important}.purple.lighten-4{background-color:#e1bee7 !important}.purple-text.text-lighten-4{color:#e1bee7 !important}.purple.lighten-3{background-color:#ce93d8 !important}.purple-text.text-lighten-3{color:#ce93d8 !important}.purple.lighten-2{background-color:#ba68c8 !important}.purple-text.text-lighten-2{color:#ba68c8 !important}.purple.lighten-1{background-color:#ab47bc !important}.purple-text.text-lighten-1{color:#ab47bc !important}.purple.darken-1{background-color:#8e24aa !important}.purple-text.text-darken-1{color:#8e24aa !important}.purple.darken-2{background-color:#7b1fa2 !important}.purple-text.text-darken-2{color:#7b1fa2 !important}.purple.darken-3{background-color:#6a1b9a !important}.purple-text.text-darken-3{color:#6a1b9a !important}.purple.darken-4{background-color:#4a148c !important}.purple-text.text-darkLine truncated
|
||||
* Waves v0.6.0
|
||||
* http://fian.my.id/Waves
|
||||
*
|
||||
* Copyright 2014 Alfiana E. Sibuea and other contributors
|
||||
* Released under the MIT license
|
||||
* https://github.com/fians/Waves/blob/master/LICENSE
|
||||
*/.waves-effect{position:relative;cursor:pointer;display:inline-block;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;vertical-align:middle;z-index:1;-webkit-transition:.3s ease-out;transition:.3s ease-out}.waves-effect .waves-ripple{position:absolute;border-radius:50%;width:20px;height:20px;margin-top:-10px;margin-left:-10px;opacity:0;background:rgba(0,0,0,0.2);-webkit-transition:all 0.7s ease-out;transition:all 0.7s ease-out;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;-webkit-transform:scale(0);transform:scale(0);pointer-events:none}.waves-effect.waves-light .waves-ripple{background-color:rgba(255,255,255,0.45)}.waves-effect.waves-red .waves-ripple{background-color:rgba(244,67,54,0.7)}.waves-effect.waves-yellow .waves-ripple{background-color:rgba(255,235,59,0.7)}.waves-effect.waves-orange .waves-ripple{background-color:rgba(255,152,0,0.7)}.waves-effect.waves-purple .waves-ripple{background-color:rgba(156,39,176,0.7)}.waves-effect.waves-green .waves-ripple{background-color:rgba(76,175,80,0.7)}.waves-effect.waves-teal .waves-ripple{background-color:rgba(0,150,136,0.7)}.waves-effect input[type="button"],.waves-effect input[type="reset"],.waves-effect input[type="submit"]{border:0;font-style:normal;font-size:inherit;text-transform:inherit;background:none}.waves-effect img{position:relative;z-index:-1}.waves-notransition{-webkit-transition:none !important;transition:none !important}.waves-circle{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-mask-image:-webkit-radial-gradient(circle, white 100%, black 100%)}.waves-input-wrapper{border-radius:0.2em;vertical-align:bottom}.waves-input-wrapper .waves-button-input{position:relative;top:0;left:0;z-index:1}.waves-circle{text-align:center;width:2.5em;height:2.5em;line-height:2.5em;border-radius:50%;-webkit-mask-image:none}.waves-block{display:block}.waves-effect .waves-ripple{z-index:-1}.modal{display:none;position:fixed;left:0;right:0;background-color:#fafafa;padding:0;max-height:70%;width:55%;margin:auto;overflow-y:auto;border-radius:2px;will-change:top, opacity}.modal:focus{outline:none}@media only screen and (max-width: 992px){.modal{width:80%}}.modal h1,.modal h2,.modal h3,.modal h4{margin-top:0}.modal .modal-content{padding:24px}.modal .modal-close{cursor:pointer}.modal .modal-footer{border-radius:0 0 2px 2px;background-color:#fafafa;padding:4px 6px;height:56px;width:100%;text-align:right}.modal .modal-footer .btn,.modal .modal-footer .btn-large,.modal .modal-footer .btn-small,.modal .modal-footer .btn-flat{margin:6px 0}.modal-overlay{position:fixed;z-index:999;top:-25%;left:0;bottom:0;right:0;height:125%;width:100%;background:#000;display:none;will-change:opacity}.modal.modal-fixed-footer{padding:0;height:70%}.modal.modal-fixed-footer .modal-content{position:absolute;height:calc(100% - 56px);max-height:100%;width:100%;overflow-y:auto}.modal.modal-fixed-footer .modal-footer{border-top:1px solid rgba(0,0,0,0.1);position:absolute;bottom:0}.modal.bottom-sheet{top:auto;bottom:-100%;margin:0;width:100%;max-height:45%;border-radius:0;will-change:bottom, opacity}.collapsible{border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;margin:.5rem 0 1rem 0}.collapsible-header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;-webkit-tap-highlight-color:transparent;line-height:1.5;padding:1rem;background-color:#fff;border-bottom:1px solid #ddd}.collapsible-header:focus{outline:0}.collapsible-header i{width:2rem;font-size:1.6rem;display:inline-block;text-align:center;margin-right:1rem}.keyboard-focused .collapsible-header:focus{background-color:#eee}.collapsible-body{display:none;border-bottom:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;padding:2rem}.sidenav .collapsible,.sidenav.fixed .collapsible{border:none;-webkit-box-shadow:none;box-shadow:none}.sidenav .collapsible li,.sidenav.fixed .collapsible li{padding:0}.sidenav .collapsible-header,.sidenav.fixed .collapsible-header{background-color:transparent;border:none;line-height:inherit;height:inherit;padding:0 16px}.sidenav .collapsible-header:hover,.sidenav.fixed .collapsible-header:hover{background-color:rgba(0,0,0,0.05)}.sidenav .collapsible-header i,.sidenav.fixed .collapsible-header i{line-height:inherit}.sidenav .collapsible-body,.sidenav.fixed .collapsible-body{border:0;background-color:#fff}.sidenav .collapsible-body li a,.sidenav.fixed .collapsible-body li a{padding:0 23.5px 0 31px}.collapsible.popout{border:none;-webkit-box-shadow:none;box-shadow:none}.collapsible.popout>li{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);margin:0 24px;-webkit-transition:margin 0.35s cubLine truncated
|
||||
visibility 0s 1s,
|
||||
-webkit-transform .3s;transition:opacity .3s,
|
||||
visibility 0s 1s,
|
||||
-webkit-transform .3s;transition:opacity .3s,
|
||||
transform .3s,
|
||||
visibility 0s 1s;transition:opacity .3s,
|
||||
transform .3s,
|
||||
visibility 0s 1s,
|
||||
-webkit-transform .3s}.tap-target{position:absolute;font-size:1rem;border-radius:50%;background-color:#ee6e73;-webkit-box-shadow:0 20px 20px 0 rgba(0,0,0,0.14),0 10px 50px 0 rgba(0,0,0,0.12),0 30px 10px -20px rgba(0,0,0,0.2);box-shadow:0 20px 20px 0 rgba(0,0,0,0.14),0 10px 50px 0 rgba(0,0,0,0.12),0 30px 10px -20px rgba(0,0,0,0.2);width:100%;height:100%;opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1),-webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1);transition:opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1),-webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1);transition:transform 0.3s cubic-bezier(0.42, 0, 0.58, 1),opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1);transition:transform 0.3s cubic-bezier(0.42, 0, 0.58, 1),opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1),-webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1)}.tap-target-content{position:relative;display:table-cell}.tap-target-wave{position:absolute;border-radius:50%;z-index:10001}.tap-target-wave::before,.tap-target-wave::after{content:'';display:block;position:absolute;width:100%;height:100%;border-radius:50%;background-color:#ffffff}.tap-target-wave::before{-webkit-transform:scale(0);transform:scale(0);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s, -webkit-transform .3s}.tap-target-wave::after{visibility:hidden;-webkit-transition:opacity .3s,
|
||||
visibility 0s,
|
||||
-webkit-transform .3s;transition:opacity .3s,
|
||||
visibility 0s,
|
||||
-webkit-transform .3s;transition:opacity .3s,
|
||||
transform .3s,
|
||||
visibility 0s;transition:opacity .3s,
|
||||
transform .3s,
|
||||
visibility 0s,
|
||||
-webkit-transform .3s;z-index:-1}.tap-target-origin{top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);z-index:10002;position:absolute !important}.tap-target-origin:not(.btn):not(.btn-large):not(.btn-small),.tap-target-origin:not(.btn):not(.btn-large):not(.btn-small):hover{background:none}@media only screen and (max-width: 600px){.tap-target,.tap-target-wrapper{width:600px;height:600px}}.pulse{overflow:visible;position:relative}.pulse::before{content:'';display:block;position:absolute;width:100%;height:100%;top:0;left:0;background-color:inherit;border-radius:inherit;-webkit-transition:opacity .3s, -webkit-transform .3s;transition:opacity .3s, -webkit-transform .3s;transition:opacity .3s, transform .3s;transition:opacity .3s, transform .3s, -webkit-transform .3s;-webkit-animation:pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;animation:pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;z-index:-1}@-webkit-keyframes pulse-animation{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}@keyframes pulse-animation{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}.datepicker-modal{max-width:325px;min-width:300px;max-height:none}.datepicker-container.modal-content{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:0}.datepicker-controls{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:280px;margin:0 auto}.datepicker-controls .selects-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.datepicker-controls .select-wrapper input{border-bottom:none;text-align:center;margin:0}.datepicker-controls .select-wrapper input:focus{border-bottom:none}.datepicker-controls .select-wrapper .caret{display:none}.datepicker-controls .select-year input{width:50px}.datepicker-controls .select-month input{width:70px}.month-prev,.month-next{margin-top:4px;cursor:pointer;background-color:transparent;border:none}.datepicker-date-display{-webkit-box-flex:1;-webkit-flex:1 auto;-ms-flex:1 auto;flex:1 auto;background-color:#26a69a;color:#fff;padding:20px 22px;font-weight:500}.datepicker-date-display .year-text{display:block;font-size:1.5rem;line-height:25px;color:rgba(255,255,255,0.7)}.datepicker-date-display .date-text{display:block;font-size:2.8rem;line-height:47px;font-weight:500}.datepicker-calendar-container{-webkit-box-flex:2.5;-webkit-flex:2.5 auto;-ms-flex:2.5 auto;flex:2.5 auto}.datepicker-table{width:280px;font-size:1rem;margin:0 auto}.datepicker-table thead{border-bottom:none}.datepicker-table th{padding:10px 5px;text-align:center}.datepicker-table tr{border:none}.datepicker-table abbr{text-decoration:none;color:#999}.datepicker-table td{border-radius:50%;padding:0}.datepicker-table td.is-today{color:#26a69a}.datepicker-table td.is-selected{background-color:#26a69a;color:#fff}.datepicker-table td.is-outside-current-month,.datepicker-table td.is-disabled{color:rgba(0,0,0,0.3);pointer-events:none}.datepicker-day-button{background-color:transparent;border:none;line-height:38px;display:block;width:100%;border-radius:50%;padding:0 5px;cursor:pointer;color:inherit}.datepicker-day-button:focus{background-color:rgba(43,161,150,0.25)}.datepicker-footer{width:280px;margin:0 auto;padding-bottom:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.datepicker-cancel,.datepicker-clear,.datepicker-today,.datepicker-done{color:#26a69a;padding:0 1rem}.datepicker-clear{color:#F44336}@media only screen and (min-width: 601px){.datepicker-modal{max-width:625px}.datepicker-container.modal-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.datepicker-date-display{-webkit-box-flex:0;-webkit-flex:0 1 270px;-ms-flex:0 1 270px;flex:0 1 270px}.datepicker-controls,.datepicker-table,.datepicker-footer{width:320px}.datepicker-day-button{line-height:44px}}.timepicker-modal{max-width:325px;max-height:none}.timepicker-container.modal-content{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:0}.text-primary{color:#fff}.timepicker-digital-display{-webkit-box-flex:1;-webkit-flex:1 auto;-ms-flex:1 auto;flex:1 auto;bLine truncated
|
||||
@@ -0,0 +1,20 @@
|
||||
body {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
|
||||
header, main, footer {
|
||||
padding-left: 300px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width : 992px) {
|
||||
header, main, footer {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
//- .row
|
||||
h1 That request failed to compile :(
|
||||
|
||||
if message
|
||||
p.flow-text= message
|
||||
@@ -0,0 +1,6 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
//- .row
|
||||
h1 Welcome to the World
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 6c3.31 0 6 2.69 6 6 0 3.32-2.69 6-6 6s-6-2.68-6-6c0-3.31 2.69-6 6-6zm0 28.4c-5.01 0-9.41-2.56-12-6.44.05-3.97 8.01-6.16 12-6.16s11.94 2.19 12 6.16c-2.59 3.88-6.99 6.44-12 6.44z"/></svg>
|
||||
|
After Width: | Height: | Size: 325 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 12.83L35.17 10 24 21.17 12.83 10 10 12.83 21.17 24 10 35.17 12.83 38 24 26.83 35.17 38 38 35.17 26.83 24z"/></svg>
|
||||
|
After Width: | Height: | Size: 210 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M18.8 33.2L9.7 24l9.2-9.2L16 12 4 24l12 12 2.8-2.8zm10.4 0l9.2-9.2-9.2-9.2L32 12l12 12-12 12-2.8-2.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 179 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M27 9c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm-7.2 27.8l1.9-8.8 4.3 4v12h4V28.9l-4.1-4.1 1.2-6C29.7 22 33.6 24 38 24v-4c-3.7 0-6.9-2-8.7-4.9l-1.9-3.2c-.7-1.2-2-1.9-3.4-1.9-.5 0-1 .1-1.5.3L12 14.6V24h4v-6.7l3.5-1.4L16.4 32l-9.8-1.9-.8 3.9s14 2.7 14 2.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 338 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M38 18h-8V6H18v12h-8l14 14 14-14zM10 36v4h28v-4H10z"/></svg>
|
||||
|
After Width: | Height: | Size: 129 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M18 32h12V20h8L24 6 10 20h8zm-8 4h28v4H10z"/></svg>
|
||||
|
After Width: | Height: | Size: 120 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 241 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
||||
<path d="M20 40V28h8v12h10V24h6L24 6 4 24h6v16z"/>
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 188 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M6 36h36v-4H6v4zm0-10h36v-4H6v4zm0-14v4h36v-4H6z"/></svg>
|
||||
|
After Width: | Height: | Size: 126 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M24 16c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 4c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 12c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg>
|
||||
|
After Width: | Height: | Size: 252 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"/>
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 163 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M-838-2232H562v3600H-838z" fill="none"/>
|
||||
<path d="M16 10v28l22-14z"/>
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 197 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M6.47 12.3C5.02 12.87 4 14.33 4 16v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V16c0-2.21-1.79-4-4-4H16.61l16.53-6.67L31.76 2 6.47 12.3zM14 40c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zm26-16h-4v-4h-4v4H8v-8h32v8z"/>
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 347 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
<path d="M14.22 17.05l-2.83-2.83c-1.8 2.32-2.91 5-3.25 7.78h4.04c.29-1.75.97-3.44 2.04-4.95zM12.18 26H8.14c.34 2.78 1.45 5.46 3.25 7.78l2.83-2.83c-1.07-1.51-1.75-3.2-2.04-4.95zm2.02 10.63c2.32 1.81 5.02 2.88 7.8 3.22v-4.04c-1.75-.29-3.43-.98-4.93-2.05l-2.87 2.87zM26 8.14V2l-9.1 9.1L26 20v-7.82c5.67.95 10 5.88 10 11.82s-4.33 10.87-10 11.82v4.04c7.89-.99 14-7.7 14-15.86S33.89 9.13 26 8.14z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 508 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
<path d="M31.1 11.1L22 2v6.14C14.11 9.12 8 15.84 8 24s6.11 14.88 14 15.86v-4.04c-5.67-.95-10-5.88-10-11.82s4.33-10.87 10-11.82V20l9.1-8.9zM39.86 22c-.34-2.78-1.45-5.46-3.25-7.78l-2.83 2.83c1.07 1.51 1.75 3.2 2.04 4.95h4.04zM26 35.81v4.05c2.78-.34 5.48-1.42 7.8-3.22l-2.87-2.87c-1.5 1.06-3.18 1.74-4.93 2.04zm7.78-4.86l2.83 2.83c1.8-2.32 2.91-5 3.25-7.78h-4.04c-.29 1.75-.97 3.44-2.04 4.95z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 507 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M31 28h-1.59l-.55-.55C30.82 25.18 32 22.23 32 19c0-7.18-5.82-13-13-13S6 11.82 6 19s5.82 13 13 13c3.23 0 6.18-1.18 8.45-3.13l.55.55V31l10 9.98L40.98 38 31 28zm-12 0c-4.97 0-9-4.03-9-9s4.03-9 9-9 9 4.03 9 9-4.03 9-9 9z"/></svg>
|
||||
|
After Width: | Height: | Size: 294 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M4.02 42L46 24 4.02 6 4 20l30 4-30 4z"/>
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 164 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3c-1.22.51-2.35 1.17-3.38 1.97L9.9 10.1c-.45-.17-.97 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3c1.22-.51 2.35-1.17 3.38-1.97l4.98 2.01c.45.17.97 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>
|
||||
|
After Width: | Height: | Size: 764 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<path d="M0 0h48v48H0z" fill="none"/>
|
||||
<path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31 0 3.22 2.61 5.83 5.83 5.83s5.83-2.61 5.83-5.83-2.61-5.83-5.83-5.83z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 503 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M30 6H12c-1.66 0-3.08 1.01-3.68 2.44l-6.03 14.1C2.11 23 2 23.49 2 24v3.83l.02.02L2 28c0 2.21 1.79 4 4 4h12.63l-1.91 9.14c-.04.2-.07.41-.07.63 0 .83.34 1.58.88 2.12L19.66 46l13.17-13.17C33.55 32.1 34 31.1 34 30V10c0-2.21-1.79-4-4-4zm8 0v24h8V6h-8z"/></svg>
|
||||
|
After Width: | Height: | Size: 324 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M2 42h8V18H2v24zm44-22c0-2.21-1.79-4-4-4H29.37l1.91-9.14c.04-.2.07-.41.07-.63 0-.83-.34-1.58-.88-2.12L28.34 2 15.17 15.17C14.45 15.9 14 16.9 14 18v20c0 2.21 1.79 4 4 4h18c1.66 0 3.08-1.01 3.68-2.44l6.03-14.1c.18-.46.29-.95.29-1.46v-3.83l-.02-.02L46 20z"/></svg>
|
||||
|
After Width: | Height: | Size: 330 B |
@@ -0,0 +1 @@
|
||||
<svg id="Logo_FIXED" data-name="Logo — FIXED" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><defs><style>.cls-1{fill:none;}.cls-2{fill:#ffffff;}</style></defs><title>Twitter_Logo_Blue</title><rect class="cls-1" width="400" height="400"/><path class="cls-2" d="M153.62,301.59c94.34,0,145.94-78.16,145.94-145.94,0-2.22,0-4.43-.15-6.63A104.36,104.36,0,0,0,325,122.47a102.38,102.38,0,0,1-29.46,8.07,51.47,51.47,0,0,0,22.55-28.37,102.79,102.79,0,0,1-32.57,12.45,51.34,51.34,0,0,0-87.41,46.78A145.62,145.62,0,0,1,92.4,107.81a51.33,51.33,0,0,0,15.88,68.47A50.91,50.91,0,0,1,85,169.86c0,.21,0,.43,0,.65a51.31,51.31,0,0,0,41.15,50.28,51.21,51.21,0,0,1-23.16.88,51.35,51.35,0,0,0,47.92,35.62,102.92,102.92,0,0,1-63.7,22A104.41,104.41,0,0,1,75,278.55a145.21,145.21,0,0,0,78.62,23"/></svg>
|
||||
|
After Width: | Height: | Size: 790 B |
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* clipboard.js v2.0.0
|
||||
* https://zenorocha.github.io/clipboard.js
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.foLine truncated
|
||||
@@ -0,0 +1,15 @@
|
||||
var clipboard = new ClipboardJS('.copy-to-clipboard');
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
console.info('Action:', e.action);
|
||||
console.info('Text:', e.text);
|
||||
console.info('Trigger:', e.trigger);
|
||||
|
||||
e.clearSelection();
|
||||
M.toast({html: 'copied'})
|
||||
});
|
||||
|
||||
clipboard.on('error', function(e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
|
||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)Line truncated
|
||||
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* Materialize v1.0.0 (http://materializecss.com)
|
||||
* Copyright 2014-2017 Materialize
|
||||
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
|
||||
*/
|
||||
var _get=function t(e,i,n){null===e&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in s)return s.value;var a=s.get;return void 0!==a?a.call(n):void 0},_createClass=function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}();function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}window.cash=function(){var i,o=document,a=window,t=Array.prototype,r=t.slice,n=t.filter,s=t.push,e=function(){},h=function(t){return typeof t==typeof e&&t.call},d=function(t){return"string"==typeof t},l=/^#[\w-]*$/,u=/^\.[\w-]*$/,c=/<.+>/,p=/^\w+$/;function v(t,e){e=e||o;var i=u.test(t)?e.getElementsByClassName(t.slice(1)):p.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t);return i}function f(t){if(!i){var e=(i=o.implementation.createHTMLDocument(null)).createElement("base");e.href=o.location.href,i.head.appendChild(e)}return i.body.innerHTML=t,i.body.childNodes}function m(t){"loading"!==o.readyState?t():o.addEventListener("DOMContentLoaded",t)}function g(t,e){if(!t)return this;if(t.cash&&t!==a)return t;var i,n=t,s=0;if(d(t))n=l.test(t)?o.getElementById(t.slice(1)):c.test(t)?f(t):v(t,e);else if(h(t))return m(t),this;if(!n)return this;if(n.nodeType||n===a)this[0]=n,this.length=1;else for(i=this.length=n.length;s<i;s++)this[s]=n[s];return this}function _(t,e){return new g(t,e)}var y=_.fn=_.prototype=g.prototype={cash:!0,length:0,push:s,splice:t.splice,map:t.map,init:g};function k(t,e){for(var i=t.length,n=0;n<i&&!1!==e.call(t[n],t[n],n,t);n++);}function b(t,e){var i=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!i&&i.call(t,e)}function w(e){return d(e)?b:e.cash?function(t){return e.is(t)}:function(t,e){return t===e}}function C(t){return _(r.call(t).filter(function(t,e,i){return i.indexOf(t)===e}))}Object.defineProperty(y,"constructor",{value:_}),_.parseHTML=f,_.noop=e,_.isFunction=h,_.isString=d,_.extend=y.extend=function(t){t=t||{};var e=r.call(arguments),i=e.length,n=1;for(1===e.length&&(t=this,n=0);n<i;n++)if(e[n])for(var s in e[n])e[n].hasOwnProperty(s)&&(t[s]=e[n][s]);return t},_.extend({merge:function(t,e){for(var i=+e.length,n=t.length,s=0;s<i;n++,s++)t[n]=e[s];return t.length=n,t},each:k,matches:b,unique:C,isArray:Array.isArray,isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}});var E=_.uid="_cash"+Date.now();function M(t){return t[E]=t[E]||{}}function O(t,e,i){return M(t)[e]=i}function x(t,e){var i=M(t);return void 0===i[e]&&(i[e]=t.dataset?t.dataset[e]:_(t).attr("data-"+e)),i[e]}y.extend({data:function(e,i){if(d(e))return void 0===i?x(this[0],e):this.each(function(t){return O(t,e,i)});for(var t in e)this.data(t,e[t]);return this},removeData:function(s){return this.each(function(t){return i=s,void((n=M(e=t))?delete n[i]:e.dataset?delete e.dataset[i]:_(e).removeAttr("data-"+name));var e,i,n})}});var L=/\S+/g;function T(t){return d(t)&&t.match(L)}function $(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function B(t,e,i){t.classList?t.classList.add(e):i.indexOf(" "+e+" ")&&(t.className+=" "+e)}function D(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(e,"")}y.extend({addClass:function(t){var n=T(t);return n?this.each(function(e){var i=" "+e.className+" ";k(n,function(t){B(e,t,i)})}):this},attr:function(e,i){if(e){if(d(e))return void 0===i?this[0]?this[0].getAttribute?this[0].getAttribute(e):this[0][e]:void 0:this.each(function(t){t.setAttribute?t.setAttribute(e,i):t[e]=i});for(var t in e)this.attr(t,e[t]);return this}},hasClass:function(t){var e=!1,i=T(t);return i&&i.length&&this.each(function(t){return!(e=$(t,i[0]))}),e},prop:function(e,i){if(d(e))return void 0===i?this[0][e]:this.each(function(t){t[e]=i});for(var t in e)this.prop(t,e[t]);return this},removeAttr:function(e){return this.each(function(t){t.removeAttribute?t.removeAttribute(e):delete t[e]})},removeClass:function(t){if(!arguments.length)return this.attr("class","");var i=T(t);return i?this.each(function(e){k(i,function(t){D(e,t)})}):this},removeProp:function(e){return this.each(function(t){delete t[e]})},toggleClass:function(t,e){if(void 0!==e)return this[e?"addClassLine truncated
|
||||
@@ -0,0 +1,9 @@
|
||||
// SITE WIDE Javascript...
|
||||
$(document).ready(function() {
|
||||
$('.sidenav').sidenav();
|
||||
$('.tabs').tabs({
|
||||
onShow: function () {
|
||||
// TODO: remove input values from other tabs...
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -0,0 +1,39 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
-
|
||||
if (data)
|
||||
var message = data.message
|
||||
data = data == null ? {} : data;
|
||||
|
||||
.container
|
||||
.row
|
||||
.col.s12
|
||||
.row
|
||||
.col.s12.l4.m3
|
||||
p
|
||||
.col.s12.l4.m6
|
||||
.center
|
||||
h2.flow-text Login/Register
|
||||
if message
|
||||
p.flow-text.red-text= message
|
||||
form(action="/account/authenticate" method="POST")
|
||||
.row
|
||||
<label for="displayName">Display Name:</label>
|
||||
<input id="displayName" type="text" name="displayName" value="#{data.displayName}" autofocus/>
|
||||
.row
|
||||
|
||||
<div class="col s12 center">
|
||||
//- <button class="btn waves-effect waves-light" v-on:click="attemptLogin">Log In</button>
|
||||
<button class="btn blue waves-effect waves-light" type="submit" name="action">Submit
|
||||
</button>
|
||||
</div>
|
||||
.col.s12.l4.m3
|
||||
p
|
||||
//- p.center
|
||||
a.center(href="/reset-password") forgot password
|
||||
//- .col.s12
|
||||
.center
|
||||
p
|
||||
strong OR
|
||||
a.btn.blue(href="/account/oauth/google") LOGIN VIA GOOGLE
|
||||
@@ -0,0 +1,28 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
-
|
||||
if (data)
|
||||
var message = data.message
|
||||
data = data == null ? {} : data;
|
||||
.container
|
||||
.center
|
||||
if displayName
|
||||
h4 Your displayName
|
||||
h3 #{displayName}
|
||||
else
|
||||
h4 Your email
|
||||
h3 #{email}
|
||||
h4 isn't linked to a HD Auth account.
|
||||
p.flow-text Wanna join?
|
||||
if message
|
||||
p.flow-text.red-text= message
|
||||
|
||||
a.btn.blue(href="/account/register") Create Account
|
||||
//- .center
|
||||
.row
|
||||
.col.s12
|
||||
p
|
||||
strong OR
|
||||
a.btn.blue(href="/account/authenticate/email") LOGIN VIA email
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
doctype html
|
||||
html(lang="en" dir="ltr")
|
||||
head
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
|
||||
<link async href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
style(media="screen")
|
||||
include ../css/site-layout.css
|
||||
style(media="screen")
|
||||
include ../css/materialize.min.css
|
||||
style(media="screen")
|
||||
include ../css/site.css
|
||||
//- style(media="screen")
|
||||
include ../css/typography.css
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
|
||||
<link rel="manifest" href="static/js/manifest.json">
|
||||
block additionalStyle
|
||||
|
||||
body
|
||||
ul.sidenav.sidenav-fixed#slide-out
|
||||
li
|
||||
.user-view
|
||||
.background
|
||||
img(src="static/images/office.jpg", alt="background")
|
||||
if user
|
||||
a#name
|
||||
span.white-text.name= user.displayName
|
||||
if user
|
||||
li
|
||||
form.center(action="/account/logout" method="POST")
|
||||
<button class="btn-flat" type="submit">logout</button>
|
||||
//- li.red-text
|
||||
a DELETE ACCOUNT
|
||||
else
|
||||
li
|
||||
a(href="/account/authenticate") login/register
|
||||
//- li
|
||||
a(href="/login/hd-auth") login with hd-auth
|
||||
|
||||
|
||||
|
||||
header(role="banner")
|
||||
block navigation
|
||||
nav
|
||||
.nav-wrapper
|
||||
a.brand-logo.center HD-Auth
|
||||
ul.left
|
||||
li
|
||||
a.sidenav-trigger(href="#", data-target="slide-out")
|
||||
i.material-icons menu
|
||||
|
||||
|
||||
main(role="main")
|
||||
.row
|
||||
.col.s12
|
||||
//- I just need the space at the top of the page to be good on mobile...
|
||||
block content
|
||||
.container
|
||||
p.flow-text Center content
|
||||
|
||||
block footer
|
||||
|
||||
footer.brand-colour.page-footer(role="footer")
|
||||
.container
|
||||
.row
|
||||
.col.s12
|
||||
p.flow-text footer content
|
||||
|
||||
.footer-copyright
|
||||
.container
|
||||
span © what year is it?
|
||||
strong Sigidli
|
||||
|
||||
//- TODO: Add a condition to use cdn in production...
|
||||
//- <script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
|
||||
script
|
||||
include ../js/jquery-3.3.1.min.js
|
||||
//- <script type="text/javascript" src="/static/js/materialize.min.js"></script>
|
||||
script
|
||||
include ../js/materialize.min.js
|
||||
|
||||
//- <script type="text/javascript" src="/static/js/site.js"></script>
|
||||
script
|
||||
include ../js/site.js
|
||||
script
|
||||
include ../js/clipboard.min.js
|
||||
script
|
||||
include ../js/copy-to-clipboard.js
|
||||
block additionalScripts
|
||||
@@ -0,0 +1,66 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
-
|
||||
if (data)
|
||||
var message = data.message
|
||||
data = data == null ? {} : data;
|
||||
|
||||
.container
|
||||
.row
|
||||
.col.s12
|
||||
.row
|
||||
.col.s12
|
||||
.center
|
||||
h2.flow-text Authentication Challenge
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
ul.tabs
|
||||
li.tab.s6
|
||||
a(href="#qr-code-tab") QR Code
|
||||
li.tab.s6
|
||||
a(href="#text-output-tab") Text
|
||||
#qr-code-tab.col.s12
|
||||
p.flow-text Scan QR Code
|
||||
a.copy-to-clipboard(data-clipboard-text=challenge)
|
||||
img.responsive-img(src=qrCode, alt="")
|
||||
#text-output-tab.col.s12
|
||||
p.flow-text
|
||||
small Please sign
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.message
|
||||
br
|
||||
small with the private key from the derivation path
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.derivationPath
|
||||
br
|
||||
small belonging to
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.xpub
|
||||
|
||||
a.btn-flat.copy-to-clipboard(data-clipboard-text=challenge) copy challenge to clipboard
|
||||
form(action="/account/register/xpub/response" method="POST")
|
||||
input(type="hidden", name="displayName", value=xpubUser.displayName)
|
||||
input(type="hidden", name="xpub", value=challenge.xpub)
|
||||
input(type="hidden", name="message", value=challenge.message)
|
||||
input(type="hidden", name="derivationPath", value=challenge.derivationPath)
|
||||
|
||||
input(type="hidden", name="request[signature]", value=challenge.request.signature)
|
||||
input(type="hidden", name="request[signatureDerivationPath]", value=challenge.request.signatureDerivationPath)
|
||||
.row
|
||||
<label for="signature">Signature:</label>
|
||||
<input id="signature" type="text" name="response[signature]" value="#{signature}"/>
|
||||
.row
|
||||
<div class="col s12 center">
|
||||
//- <button class="btn waves-effect waves-light" v-on:click="attemptLogin">Log In</button>
|
||||
<button class="btn blue waves-effect waves-light" type="submit" name="action">Respond
|
||||
</button>
|
||||
</div>
|
||||
//- p.center
|
||||
a.center(href="/reset-password") forgot password
|
||||
.col.s12
|
||||
|
||||
//- block additionalScripts
|
||||
script
|
||||
include js/copy-to-clipboard.js
|
||||
@@ -0,0 +1,65 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
-
|
||||
if (data)
|
||||
var message = data.message
|
||||
data = data == null ? {} : data;
|
||||
|
||||
.container
|
||||
.row
|
||||
.col.s12
|
||||
.row
|
||||
.col.s12
|
||||
.center
|
||||
h2.flow-text Authentication Challenge
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
ul.tabs
|
||||
li.tab.s6
|
||||
a(href="#qr-code-tab") QR Code
|
||||
li.tab.s6
|
||||
a(href="#text-output-tab") Text
|
||||
#qr-code-tab.col.s12
|
||||
p.flow-text Scan QR Code
|
||||
a.copy-to-clipboard(data-clipboard-text=challenge)
|
||||
img.responsive-img(src=qrCode, alt="")
|
||||
#text-output-tab.col.s12
|
||||
p.flow-text
|
||||
small Please sign
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.message
|
||||
br
|
||||
small with the private key from the derivation path
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.derivationPath
|
||||
br
|
||||
small belonging to
|
||||
br
|
||||
span(style="word-wrap:anywhere")= challenge.xpub
|
||||
|
||||
a.btn-flat.copy-to-clipboard(data-clipboard-text=challenge) copy challenge to clipboard
|
||||
form(action="/account/authenticate/response" method="POST")
|
||||
input(type="hidden", name="xpub", value=challenge.xpub)
|
||||
input(type="hidden", name="message", value=challenge.message)
|
||||
input(type="hidden", name="derivationPath", value=challenge.derivationPath)
|
||||
|
||||
input(type="hidden", name="request[signature]", value=challenge.request.signature)
|
||||
input(type="hidden", name="request[signatureDerivationPath]", value=challenge.request.signatureDerivationPath)
|
||||
.row
|
||||
<label for="signature">Signature:</label>
|
||||
<input id="signature" type="text" name="response[signature]" value="#{signature}"/>
|
||||
.row
|
||||
<div class="col s12 center">
|
||||
//- <button class="btn waves-effect waves-light" v-on:click="attemptLogin">Log In</button>
|
||||
<button class="btn blue waves-effect waves-light" type="submit" name="action">Respond
|
||||
</button>
|
||||
</div>
|
||||
//- p.center
|
||||
a.center(href="/reset-password") forgot password
|
||||
.col.s12
|
||||
|
||||
//- block additionalScripts
|
||||
script
|
||||
include js/copy-to-clipboard.js
|
||||