summaryrefslogtreecommitdiff
path: root/public/js/lib/common
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/lib/common')
-rw-r--r--public/js/lib/common/login.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/public/js/lib/common/login.js b/public/js/lib/common/login.js
index 18cd377d..28e5b470 100644
--- a/public/js/lib/common/login.js
+++ b/public/js/lib/common/login.js
@@ -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 {