Skip to content

Commit 40ab4e4

Browse files
committed
Fix login issue
1 parent 8c1a80b commit 40ab4e4

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/connector.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import Vue from 'vue'
44
import reqwest from './plugins/reqwest.js'
55
import { _t } from './plugins/gettext.js'
66

7-
const serverUrl = 'http://localhost:9092'
8-
97
const ACCESS_TOKEN_KEY = 'ACCESS_TOKEN'
108
const REFRESH_TOKEN_KEY = 'REFRESH_TOKEN'
119

12-
const clientId = '0gvr1GFNpCy9fSpxsKHPdUPUu7ZSCQS76zc8kAgl'
13-
const clientSecret = 'dazoA4IhCGrWrkh2rA02FE1qm3AVWdAz9qKqSZDLAD22xWiVYsEeMtq2BmqVY748U8Qw9jecBo9BHYYG3nZDgOUUwaEFjjDir1VX25ejnCvEcwdzV3Wt2Rxcnt45lxaN'
10+
// const serverUrl = 'http://localhost:9092'
11+
// const clientId = '0gvr1GFNpCy9fSpxsKHPdUPUu7ZSCQS76zc8kAgl'
12+
// const clientSecret = 'dazoA4IhCGrWrkh2rA02FE1qm3AVWdAz9qKqSZDLAD22xWiVYsEeMtq2BmqVY748U8Qw9jecBo9BHYYG3nZDgOUUwaEFjjDir1VX25ejnCvEcwdzV3Wt2Rxcnt45lxaN'
13+
14+
const serverUrl = 'https://codebang.dashingsoft.com'
15+
const clientId = 'rgt9yKrM82ACFiKLW2aIwxYUCIUV8ggx2OH5hvu8'
16+
const clientSecret = 'hiWi4Q8k4TR1aAF8PGtqjL7DiY15gBFXjYQ9UM5F3EV5mneJbo88LlXqst0PcfpYVhPQyKc1jjlICggI0otTjOv6zoP89Q0uBNoLsEqkRVmi2G4w5Snn9dBADHx7UxaT'
1417

1518
// Fix this issue:
1619
// Do not access Object.prototype method ‘hasOwnProperty’ from target object no-prototype-builtins
@@ -177,9 +180,9 @@ const make_multipart_data = function (args, files) {
177180
}
178181

179182
export default new Vue({
180-
computed: {
181-
isAuthenticated: function () {
182-
return is_authenticated()
183+
data: {
184+
return {
185+
isAuthenticated: false
183186
}
184187
},
185188
methods: {
@@ -249,6 +252,7 @@ export default new Vue({
249252
const callback = function (success, result) {
250253
if (!success && !silent)
251254
this.showError(result.message)
255+
this.isAuthenticated = is_authenticated()
252256
this.$emit('api-login', success, result)
253257
}.bind(this)
254258
get_token(username, password, callback)
@@ -257,6 +261,7 @@ export default new Vue({
257261
const callback = function (success, result) {
258262
if (!success && !silent)
259263
this.showError(result.message)
264+
this.isAuthenticated = is_authenticated()
260265
this.$emit('api-logout', success, result)
261266
}.bind(this)
262267
revoke_token(callback)

0 commit comments

Comments
 (0)