diff --git a/src/manifest.json b/src/manifest.json
index e5c156c..ad1ec00 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -16,10 +16,8 @@
"storage",
"cookies",
"contextMenus",
- "https://*.simplelogin.io/*"
- ],
- "optional_permissions": [
"tabs",
+ "https://*.simplelogin.io/*",
"http://*/*",
"https://*/*"
],
@@ -38,17 +36,17 @@
]
},
"commands": {
- "generate-random-alias": {
- "suggested_key": {
- "default": "Ctrl+Shift+X"
- },
- "description": "Generate a random email alias"
- },
- "_execute_browser_action": {
- "suggested_key": {
- "default": "Ctrl+Shift+S"
- },
- "description":"Open the extension action menu"
- }
+ "generate-random-alias": {
+ "suggested_key": {
+ "default": "Ctrl+Shift+X"
+ },
+ "description": "Generate a random email alias"
+ },
+ "_execute_browser_action": {
+ "suggested_key": {
+ "default": "Ctrl+Shift+S"
+ },
+ "description":"Open the extension action menu"
+ }
}
}
diff --git a/src/onboarding/Onboarding.vue b/src/onboarding/Onboarding.vue
index ac08d93..6d1f606 100644
--- a/src/onboarding/Onboarding.vue
+++ b/src/onboarding/Onboarding.vue
@@ -4,8 +4,7 @@
-
-
Welcome {{ userName }}!
-
-
-
-
Extra permission
-
- SimpleLogin extension requires the
- Read and change all your data on the websites you visit
- Access your data for all websites & access browser tabs
- permission.
-
-
-
-
-
-
- Though seemingly scary, the only thing SimpleLogin does is to
- detect the email field on a page and display the icon to its
- right.
-
-
-
-
-
- SimpleLogin code is open-source on
- GitHub
- if you want to know about what's going behind the scenes.
-
-
-
-
- Approve access permission
-
-
- Skip
-
-
-
-
It's all set!
To start using SimpleLogin, please click on
@@ -175,9 +108,9 @@ export default {
this.url.createNewAccount = `${apiUrl}/auth/register?next=%2Fdashboard%2Fsetup_done`;
this.url.login = `${apiUrl}/dashboard/setup_done`;
- // maybe user redirected from the setup_done page
- if (this.step === 3) {
- await this.tryGetUserInfo();
+ if (await this.tryGetUserInfo()) {
+ this.step = 3;
+ return;
}
// update setup step
@@ -206,23 +139,22 @@ export default {
},
async tryGetUserInfo() {
const apiUrl = await SLStorage.get(SLStorage.SETTINGS.API_URL);
- const that = this;
- // check api key
- axios
- .get(apiUrl + API_ROUTE.GET_USER_INFO.path, {
- headers: { Authentication: this.apiKey },
- })
- .then(async (res) => {
- that.userName = res.data.name || res.data.email;
- that.isAuthenticated = true;
+ try {
+ // check api key
+ const response = await axios.get(
+ apiUrl + API_ROUTE.GET_USER_INFO.path,
+ { headers: { Authentication: this.apiKey } }
+ );
+ this.userName = response.data.name || response.data.email;
+ this.isAuthenticated = true;
- await SLStorage.set(SLStorage.SETTINGS.API_KEY, this.apiKey);
- EventManager.broadcast(EventManager.EVENT.SETTINGS_CHANGED);
- })
- .catch((err) => {
- // user isn't authenticated, ignore
- });
+ await SLStorage.set(SLStorage.SETTINGS.API_KEY, this.apiKey);
+ EventManager.broadcast(EventManager.EVENT.SETTINGS_CHANGED);
+ return true;
+ } catch (err) {
+ return false;
+ }
},
},
};