Skip to content

Commit 0591817

Browse files
authored
feat: Check 2 cookie values (#1)
* feat: check 2 cookie values * fix: remove print statements
1 parent dca638a commit 0591817

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/StacBrowser.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ export default {
266266
beforeCreate() {
267267
const cookies = cookie.parse(document.cookie);
268268
let MAIN_SETTING = 'SETTING_PLACEHOLDER'
269-
console.log(`MAIN_SETTING: ${JSON.stringify(MAIN_SETTING)}`)
270269
if (typeof MAIN_SETTING === 'object' && MAIN_SETTING.constructor === Object) {
271270
if (MAIN_SETTING['catalogUrl'] === undefined) {
272271
MAIN_SETTING['catalogUrl'] = null
@@ -278,8 +277,15 @@ export default {
278277
}
279278
console.log(`MAIN_SETTING: ${JSON.stringify(MAIN_SETTING)}`)
280279
this.$store.dispatch('setCatalogUrl', MAIN_SETTING['catalogUrl'])
280+
let unity_token = undefined
281281
if (cookies['unity_token'] !== undefined) {
282-
this.$store.dispatch('setAuth', cookies['unity_token']);
282+
unity_token = cookies['unity_token']
283+
}
284+
if (cookies['oidc_access_token'] !== undefined && unity_token === undefined) {
285+
unity_token = cookies['oidc_access_token']
286+
}
287+
if (unity_token !== undefined) {
288+
this.$store.dispatch('setAuth', unity_token);
283289
}
284290
},
285291
created() {

0 commit comments

Comments
 (0)