mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
fixes for duo login on safari
This commit is contained in:
parent
a3d3aac8be
commit
35385b8c98
@ -22,18 +22,18 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
host: msg.data.host,
|
||||
sig_request: msg.data.signature,
|
||||
submit_callback: (theForm: Document) => {
|
||||
const sigElement = theForm.querySelector('input[name="sig_response"]');
|
||||
const sigElement = theForm.querySelector('input[name="sig_response"]') as HTMLInputElement;
|
||||
if (sigElement) {
|
||||
safari.self.tab.dispatchMessage('bitwarden', {
|
||||
command: '2faPageResponse',
|
||||
type: 'duo',
|
||||
data: {
|
||||
sigValue: sigElement.nodeValue,
|
||||
sigValue: sigElement.value,
|
||||
},
|
||||
});
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// TODO: others like u2f?
|
||||
|
@ -123,6 +123,8 @@ angular
|
||||
});
|
||||
|
||||
$scope.$on('2faPageResponse', (event, details) => {
|
||||
console.log('got 2fa response');
|
||||
console.log(details);
|
||||
if (details.type === 'duo') {
|
||||
$scope.login(details.data.sigValue);
|
||||
}
|
||||
@ -167,6 +169,7 @@ angular
|
||||
BrowserApi.tabSendMessage(tabToSend, {
|
||||
command: '2faPageData',
|
||||
data: {
|
||||
type: 'duo',
|
||||
host: params.Host,
|
||||
signature: params.Signature
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ export class MainController implements ng.IController {
|
||||
});
|
||||
|
||||
$window.bitwardenPopupMainMessageListener = (msg: any, sender: any, sendResponse: any) => {
|
||||
console.log(msg);
|
||||
|
||||
if (msg.command === 'syncCompleted') {
|
||||
$scope.$broadcast('syncCompleted', msg.successfully);
|
||||
} else if (msg.command === 'syncStarted') {
|
||||
|
Loading…
Reference in New Issue
Block a user