mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-02-11 17:55:49 +00:00
added auth request
This commit is contained in:
parent
2e03004938
commit
ca00025c86
@ -788,6 +788,27 @@ if (!window.hasAddedQortalListener) {
|
||||
if (event.source !== window || !event.data || !event.data.action) return;
|
||||
|
||||
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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user