mirror of https://github.com/status-im/codimd.git
refactor: fix lint warning on public/js/lib/common/login.js
Signed-off-by: BoHong Li <a60814billy@gmail.com>
This commit is contained in:
parent
bf727b5878
commit
b0dee3ee14
|
@ -60,22 +60,22 @@ export function checkIfAuth (yesCallback, noCallback) {
|
|||
if (checkLoginStateChanged()) checkAuth = false
|
||||
if (!checkAuth || typeof cookieLoginState === 'undefined') {
|
||||
$.get(`${serverurl}/me`)
|
||||
.done(data => {
|
||||
if (data && data.status === 'ok') {
|
||||
profile = data
|
||||
yesCallback(profile)
|
||||
setLoginState(true, data.id)
|
||||
} else {
|
||||
noCallback()
|
||||
setLoginState(false)
|
||||
}
|
||||
})
|
||||
.fail(() => {
|
||||
noCallback()
|
||||
})
|
||||
.always(() => {
|
||||
checkAuth = true
|
||||
})
|
||||
.done(data => {
|
||||
if (data && data.status === 'ok') {
|
||||
profile = data
|
||||
yesCallback(profile)
|
||||
setLoginState(true, data.id)
|
||||
} else {
|
||||
noCallback()
|
||||
setLoginState(false)
|
||||
}
|
||||
})
|
||||
.fail(() => {
|
||||
noCallback()
|
||||
})
|
||||
.always(() => {
|
||||
checkAuth = true
|
||||
})
|
||||
} else if (cookieLoginState) {
|
||||
yesCallback(profile)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue