mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-03-28 16:25:54 +00:00
added auth request
This commit is contained in:
parent
2e03004938
commit
ca00025c86
@ -789,6 +789,27 @@ if (!window.hasAddedQortalListener) {
|
||||
|
||||
if (event?.data?.requestedHandler !== 'UI') return;
|
||||
|
||||
await new Promise((res)=> {
|
||||
chrome?.runtime?.sendMessage(
|
||||
{
|
||||
action: "authentication",
|
||||
timeout: 60,
|
||||
},
|
||||
(response) => {
|
||||
if (response.error) {
|
||||
eventPort.postMessage({
|
||||
result: null,
|
||||
error: 'User not authenticated',
|
||||
});
|
||||
res()
|
||||
return
|
||||
} else {
|
||||
res()
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
const sendMessageToRuntime = (message, eventPort) => {
|
||||
chrome?.runtime?.sendMessage(message, (response) => {
|
||||
console.log('response', response);
|
||||
|
Loading…
x
Reference in New Issue
Block a user