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