Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating libs together with code to compatibility. #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
-.vscode/tasks.json
-.vscode/settings.json

package-lock.json
yarn.lock
node_modules/
temp/
dist/
Expand Down
24 changes: 16 additions & 8 deletions build/webpack/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const webpack = require('webpack');
const config = require('../../server/config');

module.exports = {
devtool: "inline-eval-cheap-source-map",
devtool: "inline-cheap-source-map",
entry: {
main: "./src/index.ts", // main application page
// TODO: add more entries here, one per each reloadable page
Expand All @@ -21,6 +21,9 @@ module.exports = {
'node_modules', // standard NPM modules
'modules', // non-NPM modules
],
fallback: {
fs: false
},
extensions: [ '.ts', '.mjs', '.js' ], // try to resolve extension of require('module') in this order
},
externals: [
Expand All @@ -37,14 +40,19 @@ module.exports = {
devServer: {
host: config.site.host,
port: config.site.port,
https: true,
pfx: config.site.sslCertificate.pfxFilename,
pfxPassphrase: config.site.sslCertificate.passphrase,
publicPath: '/',
https: {
pfx: config.site.sslCertificate.pfxFilename,
pfxPassphrase: config.site.sslCertificate.passphrase,
},
//devMiddleware: {
// publicPath: '/'
//},
historyApiFallback: true,
contentBase: [
'out/public/'
],
//contentBase: [
static : [{
directory : 'out/public/',
publicPath: '/'
}],
},
plugins: [
new HtmlWebpackPlugin({
Expand Down
88 changes: 73 additions & 15 deletions build/webpack/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,89 @@ const path = require("path");
// to prevent Typescript import errors.
//
module.exports = [
{ test: /\.ts(x?)$/ , loader: 'ts-loader' },
{ test: /\.css$/ , loader: 'style-loader!css-loader' },
{ test: /\.scss$/ , loader: 'style-loader!css-loader!sass-loader' },
{ test: /\.ts(x?)$/ , use: ['ts-loader'] },
{ test: /\.css$/ , use: ['style-loader','css-loader'] },
{ test: /\.scss$/ , use: ['style-loader','css-loader','sass-loader'] },

{ test: /\.html$/ , loader: 'raw-loader' , exclude: /node_modules/ },
{ test: /\.png$/ , loader: 'url-loader' , exclude: /node_modules/ },

{ test: /\.jpg$/ , loader: 'file-loader?name=[name].[hash:6].[ext]', exclude: /node_modules/ },
{ test: /\.html$/ , use: ['raw-loader'] , exclude: /node_modules/ },
{ test: /\.png$/ , use: ['url-loader'] , exclude: /node_modules/ },

{ test: /\.jpg$/ ,
use: [{
loader: 'file-loader',
options: {
name: '[name].[hash:6].[ext]',
},
}],
exclude: /node_modules/
},
{ test: /\.json$/,
loader: "file-loader?name=[path][name].[ext]&context=src/",
use: [{
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
context: 'src/',
},
}],
exclude: /node_modules/,
type: 'javascript/auto'
},
{ test: /modules/,
loader: "file-loader?name=[path][name].[ext]&context=src/",
use: [{
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
context: 'src/',
},
}],
exclude: /node_modules/,
type: 'javascript/auto'
},
{ test: /-shard1$/, loader: "file-loader?name=[path][name]&context=src/", exclude: /node_modules/ },

{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader?mimetype=image/svg+xml&name=[name].[hash:6].[ext]'},
{test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: "file-loader?mimetype=application/font-woff&name=[name].[hash:6].[ext]"},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "file-loader?mimetype=application/octet-stream&name=[name].[hash:6].[ext]"},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file-loader?name=[name].[hash:6].[ext]"},
{ test: /-shard1$/,
use: [{
loader: 'file-loader',
options: {
name: '[path][name]',
context: 'src/',
},
}],
exclude: /node_modules/
},
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
mimetype: 'image/svg+xml',
name: '[name].[hash:6].[ext]',
},
}],
},
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
mimetype: 'application/font-woff',
name: '[name].[hash:6].[ext]',
},
}],
},
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
mimetype: 'application/octet-stream',
name: '[name].[hash:6].[ext]',
},
}],
},
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[hash:6].[ext]',
},
}],
},
// { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/ , loader: 'file-loader' },
// { test: /\.ttf(\?v=[0-9]\.[0-9]\.[0-9])?$/ , loader: 'file-loader?mimetype=' },
// { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/ , loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
Expand Down
2 changes: 1 addition & 1 deletion build/webpack/preloaders.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = [
{
test: /\.ts$/,
loader: 'tslint'
use: ['tslint']
}
];
25 changes: 17 additions & 8 deletions build/webpack/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ module.exports = {
}
},
},
moduleIds: 'deterministic',
},
resolve: {
modules: [
path.resolve(__dirname, "src/modules"),
'node_modules', // standard NPM modules
'modules', // non-NPM modules
],
fallback: {
fs: false
},
extensions: [ '.ts', '.mjs', '.js' ], // try to resolve extension of require('module') in this order
},
externals: [
Expand All @@ -50,14 +54,19 @@ module.exports = {
devServer: {
host: config.site.host,
port: config.site.port,
https: true,
pfx: config.site.sslCertificate.pfxFilename,
pfxPassphrase: config.site.sslCertificate.passphrase,
publicPath: '/',
https: {
pfx: config.site.sslCertificate.pfxFilename,
pfxPassphrase: config.site.sslCertificate.passphrase,
},
//devMiddleware: {
// publicPath: '/'
//},
historyApiFallback: true,
contentBase: [
'out/public/'
],
//contentBase: [
static : [{
directory : 'out/public/',
publicPath: '/'
}],
},
plugins: [
// new webpack.optimize.UglifyJsPlugin(
Expand All @@ -78,7 +87,7 @@ module.exports = {
// 'window.jQuery': 'jquery',
// 'window.jquery': 'jquery'
// })
new webpack.HashedModuleIdsPlugin(),
//new webpack.HashedModulesPlugin(),
],
resolveLoader: {
alias: {
Expand Down
118 changes: 59 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,76 @@
"description": "Example of using @digitalpersona/* libraries in an AngularJS application",
"main": "index.js",
"scripts": {
"server": "supervisor -w server ./server/index.js",
"server-dev": "set NODE_TLS_REJECT_UNAUTHORIZED=0&& set DEBUG=app*&& supervisor -w server ./server/index.js",
"server": "nodemon -w server ./server/index.js",
"server-dev": "set NODE_TLS_REJECT_UNAUTHORIZED=0&& set DEBUG=app*&& nodemon -V --trace-warnings --inspect -w server ./server/index.js",
"clean": "rimraf ./out",
"tsc": "tsc --p tsconfig.typings.json",
"build": "npm run clean && npm run tsc",
"build-dev": "webpack --config build/webpack/dev.js --NODE_ENV=dev",
"build-dev-watch": "webpack --config build/webpack/dev.js --watch --NODE_ENV=dev",
"build-prod": "webpack --config build/webpack/prod.js --NODE_ENV=production",
"start-dev": "webpack --config build/webpack/dev.js & webpack-dev-server --config build/webpack/dev.js"
"build-dev": "webpack --config build/webpack/dev.js --mode development --node-env dev",
"build-dev-watch": "webpack --config build/webpack/dev.js --mode development --watch --node-env dev",
"build-prod": "webpack --config build/webpack/prod.js --mode production --node-env production",
"start-dev": "webpack --config build/webpack/dev.js --mode development & webpack-dev-server --config build/webpack/dev.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"@digitalpersona/authentication": "^0.2",
"@digitalpersona/devices": "^0.2",
"@digitalpersona/enrollment": "^0.2",
"angular": "^1.7.8",
"angular-animate": "^1.7.8",
"angular-aria": "^1.7.8",
"angular-cookies": "^1.7.8",
"angular-messages": "^1.7.8",
"angular-route": "^1.7.8",
"angular-sanitize": "^1.7.8",
"angular-translate": "^2.18.1",
"angular-translate-loader-static-files": "^2.18.1",
"angular-translate-storage-cookie": "^2.18.1",
"angular-translate-storage-local": "^2.18.1",
"@digitalpersona/authentication": "^0.2.6",
"@digitalpersona/devices": "^0.2.6",
"@digitalpersona/enrollment": "^0.2.6",
"angular": "^1.8.2",
"angular-animate": "^1.8.2",
"angular-aria": "^1.8.2",
"angular-cookies": "^1.8.2",
"angular-messages": "^1.8.2",
"angular-route": "^1.8.2",
"angular-sanitize": "^1.8.2",
"angular-translate": "^2.19.0",
"angular-translate-loader-static-files": "^2.19.0",
"angular-translate-storage-cookie": "^2.19.0",
"angular-translate-storage-local": "^2.19.0",
"angular-ui-bootstrap": "^2.5.6",
"base-64": "^0.1.0",
"bootstrap": "^3.3.7",
"debug": "^4.1.1",
"express": "^4.16.4",
"face-api.js": "^0.20.0",
"base-64": "^1.0.0",
"bootstrap": "^5.1.1",
"debug": "^4.3.2",
"express": "^4.17.1",
"face-api.js": "^0.22.2",
"font-awesome": "^4.7.0",
"node-fetch": "^2.6.0",
"nodemailer": "^6.3.0",
"qrcode-generator": "^1.4.3",
"tslib": "^1.9.3",
"win-ca": "^3.0.5"
"node-fetch": "^3.0.0",
"nodemailer": "^6.6.3",
"qrcode-generator": "^1.4.4",
"tslib": "^2.3.1",
"win-ca": "^3.4.5"
},
"devDependencies": {
"@types/angular": "^1.6.54",
"@types/angular-animate": "^1.5.10",
"@types/angular-cookies": "^1.4.5",
"@types/angular-route": "^1.7.0",
"@types/angular-sanitize": "^1.3.7",
"@types/angular-translate": "^2.16.0",
"@types/angular-ui-bootstrap": "^0.13.47",
"@types/bootstrap": "^3.3.7",
"@types/node": "^11.13.7",
"@types/webpack": "^4.4.31",
"@types/webpack-env": "^1.13.9",
"bootstrap-sass": "^3.3.7",
"browser-sync": "^2.26.4",
"browser-sync-webpack-plugin": "^2.2.2",
"compression-webpack-plugin": "^2.0.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-webpack-plugin": "^3.2.0",
"node-sass": "^4.11.0",
"raw-loader": "^2.0.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"ts-loader": "^5.4.3",
"tslint": "^5.16.0",
"@types/angular": "^1.8.2",
"@types/angular-animate": "^1.5.11",
"@types/angular-cookies": "^1.8.1",
"@types/angular-route": "^1.7.2",
"@types/angular-sanitize": "^1.8.1",
"@types/angular-translate": "^2.16.3",
"@types/angular-ui-bootstrap": "^1.0.1",
"@types/bootstrap": "^5.1.4",
"@types/node": "^16.9.1",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.16.2",
"bootstrap-sass": "^3.4.1",
"browser-sync": "^2.27.5",
"browser-sync-webpack-plugin": "^2.3.0",
"compression-webpack-plugin": "^9.0.0",
"css-loader": "^6.2.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"node-sass": "^6.0.1",
"raw-loader": "^4.0.2",
"sass-loader": "^12.1.0",
"style-loader": "^3.2.1",
"ts-loader": "^9.2.5",
"tslint": "^6.1.3",
"tslint-loader": "^3.5.4",
"typescript": "^3.4.5",
"url-loader": "^1.1.2",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.1",
"webpack-dev-server": "^3.3.1"
"typescript": "^4.4.3",
"url-loader": "^4.1.1",
"webpack": "^5.52.1",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.2.1"
}
}
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const base64 = require('base-64');
global.btoa = function(s) { return base64.encode(s); }
global.atob = function(s) { return base64.decode(s); }

global.fetch = require('node-fetch');
//global.fetch = require('node-fetch');
global.fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));

// Import Root Certificate Authorities from the Windows certificate store
require('win-ca')
Expand Down Expand Up @@ -39,4 +40,3 @@ const httpsOptions = {
https
.createServer(httpsOptions, app)
.listen(config.site.port, config.site.host);

8 changes: 6 additions & 2 deletions src/application/identity/signin/signin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ export default class SigninControl
}

public $onDestroy() {
//if (typeof this.fingerprintReader !== 'undefined') {
this.fingerprintReader.stopAcquisition();
this.fingerprintReader.off();
delete this.fingerprintReader;
//}
//delete this.fingerprintReader;

//if (typeof this.cardReader !== 'undefined') {
this.cardReader.unsubscribe();
this.cardReader.off();
delete this.cardReader;
//}
//delete this.cardReader;
}

private updateCredentials() {
Expand Down
Loading