This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
getCsrfTokenFromCookie,
|
getCsrfTokenFromCookie,
|
||||||
saveAuthToken
|
saveAuthToken
|
||||||
} from '../utils/auth'
|
} from '../utils/auth'
|
||||||
|
import { AuthSuccess } from '~/graphql/generated/graphql'
|
||||||
/**
|
/**
|
||||||
* Модуль авторизации
|
* Модуль авторизации
|
||||||
* @module auth
|
* @module auth
|
||||||
@@ -159,7 +160,7 @@ export const AuthProvider: Component<AuthProviderProps> = (props) => {
|
|||||||
export const logout = async () => {
|
export const logout = async () => {
|
||||||
console.log('[Auth] Executing standalone logout...')
|
console.log('[Auth] Executing standalone logout...')
|
||||||
try {
|
try {
|
||||||
const result = await query<{ logout: { success: boolean } }>(
|
const result = await query<{ logout: AuthSuccess }>(
|
||||||
`${location.origin}/graphql`,
|
`${location.origin}/graphql`,
|
||||||
ADMIN_LOGOUT_MUTATION
|
ADMIN_LOGOUT_MUTATION
|
||||||
)
|
)
|
||||||
|
@@ -19,7 +19,6 @@ export const ADMIN_LOGOUT_MUTATION = `
|
|||||||
mutation AdminLogout {
|
mutation AdminLogout {
|
||||||
logout {
|
logout {
|
||||||
success
|
success
|
||||||
message
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
@@ -148,7 +148,7 @@ async def logout(_: None, info: GraphQLResolveInfo, **kwargs: Any) -> dict[str,
|
|||||||
return result
|
return result
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Ошибка выхода: {e}")
|
logger.error(f"Ошибка выхода: {e}")
|
||||||
return {"success": False, "message": str(e)}
|
return {"success": False}
|
||||||
|
|
||||||
|
|
||||||
@mutation.field("refreshToken")
|
@mutation.field("refreshToken")
|
||||||
|
Reference in New Issue
Block a user