u2d lib is externals
This commit is contained in:
parent
bf5d8cab1c
commit
5760efdaa1
|
@ -35,12 +35,13 @@ export class TwoFactorU2fComponent implements OnInit, OnDestroy {
|
|||
u2fListening: boolean;
|
||||
u2fResponse: string;
|
||||
masterPassword: string;
|
||||
u2fScript: HTMLScriptElement;
|
||||
|
||||
authPromise: Promise<any>;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
private masterPasswordHash: string;
|
||||
private closed = false;
|
||||
private u2fScript: HTMLScriptElement;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private analytics: Angulartics2, private toasterService: ToasterService,
|
||||
|
@ -55,6 +56,7 @@ export class TwoFactorU2fComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.closed = true;
|
||||
window.document.body.removeChild(this.u2fScript);
|
||||
}
|
||||
|
||||
|
@ -86,7 +88,7 @@ export class TwoFactorU2fComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
private readDevice() {
|
||||
if (this.enabled) {
|
||||
if (this.closed || this.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Bitwarden U2F Connector</title>
|
||||
<script src="../scripts/u2f.js"></script>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require('../scripts/u2f');
|
||||
import * as u2f from 'u2f';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function (event) {
|
||||
init();
|
||||
|
|
|
@ -147,6 +147,9 @@ const config = {
|
|||
'connectors/u2f': './src/connectors/u2f.js',
|
||||
'connectors/duo': './src/connectors/duo.ts',
|
||||
},
|
||||
externals: {
|
||||
'u2f': 'u2f',
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
alias: {
|
||||
|
|
Loading…
Reference in New Issue