|
|
@ -9,7 +9,7 @@ import moment from "moment"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
GlobalContainerService, |
|
|
|
GlobalContainerService, |
|
|
|
notificationsService, |
|
|
|
notificationsService, |
|
|
|
SocketIo |
|
|
|
SocketIo, |
|
|
|
} from "../system"; |
|
|
|
} from "../system"; |
|
|
|
import { accountService } from "./account.service"; |
|
|
|
import { accountService } from "./account.service"; |
|
|
|
import { configsService } from "./configs.service"; |
|
|
|
import { configsService } from "./configs.service"; |
|
|
@ -58,9 +58,8 @@ const signIn = async (payload: ISignIn) => { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
afterAuth().catch((e) => console.log("error on after auth", e)); |
|
|
|
await configsService.loadFilesLimitsConfig(); |
|
|
|
await configsService.loadFilesLimitsConfig(); |
|
|
|
|
|
|
|
|
|
|
|
afterAuth().catch(e => console.log("error on after auth", e)); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log("AUTH ERROR", e); |
|
|
|
console.log("AUTH ERROR", e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
@ -79,9 +78,9 @@ const autoAuth = async () => { |
|
|
|
await refreshSession(existTokens.refreshToken); |
|
|
|
await refreshSession(existTokens.refreshToken); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await configsService.loadFilesLimitsConfig(); |
|
|
|
afterAuth().catch((e) => console.log("error on after auth", e)); |
|
|
|
|
|
|
|
|
|
|
|
afterAuth().catch(e => console.log("error on after auth", e)); |
|
|
|
await configsService.loadFilesLimitsConfig(); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log("AUTO AUTH ERROR", e); |
|
|
|
console.log("AUTO AUTH ERROR", e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
@ -139,7 +138,7 @@ const refreshSession = async (refreshToken?: string, reloadUserData = true) => { |
|
|
|
if (!token) return; |
|
|
|
if (!token) return; |
|
|
|
|
|
|
|
|
|
|
|
const { data } = await authApi.sendRefreshToken({ |
|
|
|
const { data } = await authApi.sendRefreshToken({ |
|
|
|
refreshToken: token |
|
|
|
refreshToken: token, |
|
|
|
}); |
|
|
|
}); |
|
|
|
await _saveTokens(data); |
|
|
|
await _saveTokens(data); |
|
|
|
|
|
|
|
|
|
|
@ -188,7 +187,7 @@ const recoverAccountPassword = async (payload: IRecoverPassword) => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const { data } = await authApi.passwordRecoveryReq({ |
|
|
|
const { data } = await authApi.passwordRecoveryReq({ |
|
|
|
...payload, |
|
|
|
...payload, |
|
|
|
deviceName: "web" |
|
|
|
deviceName: "web", |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (data) await _saveTokens(data); |
|
|
|
if (data) await _saveTokens(data); |
|
|
@ -219,5 +218,5 @@ export const authService = { |
|
|
|
recoverAccountPassword, |
|
|
|
recoverAccountPassword, |
|
|
|
refreshSession, |
|
|
|
refreshSession, |
|
|
|
logout, |
|
|
|
logout, |
|
|
|
stopSession |
|
|
|
stopSession, |
|
|
|
}; |
|
|
|
}; |
|
|
|