send log_in and log_out event
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"activeTab",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"nativeMessaging",
|
||||
"https://*.simplelogin.io/*",
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
v-show="showSLButton"
|
||||
target="_blank"
|
||||
>
|
||||
<br /><font-awesome-icon icon="bug" /> Report an issue
|
||||
<br />
|
||||
<font-awesome-icon icon="bug" />
|
||||
Report an issue
|
||||
</a>
|
||||
</small>
|
||||
</td>
|
||||
@@ -165,6 +167,17 @@ export default {
|
||||
await SLStorage.remove(SLStorage.SETTINGS.API_KEY);
|
||||
EventManager.broadcast(EventManager.EVENT.SETTINGS_CHANGED);
|
||||
Navigation.clearHistoryAndNavigateTo(Navigation.PATH.LOGIN);
|
||||
|
||||
try {
|
||||
console.log("send log out event to host app");
|
||||
let r = await browser.runtime.sendNativeMessage("application.id", {
|
||||
message: {
|
||||
logged_out: {},
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.info("can't send data to native app", error);
|
||||
}
|
||||
},
|
||||
|
||||
async setMailToUri() {
|
||||
|
||||
@@ -93,7 +93,8 @@
|
||||
class="btn btn-outline-primary btn-sm"
|
||||
@click="createRandomAlias"
|
||||
>
|
||||
<font-awesome-icon icon="random" /> OR create a totally random alias
|
||||
<font-awesome-icon icon="random" />
|
||||
OR create a totally random alias
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -257,6 +258,24 @@ export default {
|
||||
this.apiUrl = await SLStorage.get(SLStorage.SETTINGS.API_URL);
|
||||
this.apiKey = await SLStorage.get(SLStorage.SETTINGS.API_KEY);
|
||||
|
||||
if (this.apiKey) {
|
||||
try {
|
||||
console.log("send api key to host app");
|
||||
let r = await browser.runtime.sendNativeMessage("application.id", {
|
||||
message: {
|
||||
logged_in: {
|
||||
data: {
|
||||
api_key: this.apiKey,
|
||||
api_url: this.apiUrl,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.info("can't send data to native app", error);
|
||||
}
|
||||
}
|
||||
|
||||
this.contentElem = document.querySelector(".app > .content");
|
||||
|
||||
await this.getUserOptions();
|
||||
|
||||
Reference in New Issue
Block a user