mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-14 20:22:10 +00:00
feat: omit username and tokens in logs
This commit is contained in:
parent
192008c76c
commit
5b18aba2b8
1 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,7 @@ import { uploadGamesBatch } from "./library-sync";
|
|||
import { clearGamesRemoteIds } from "./library-sync/clear-games-remote-id";
|
||||
import { logger } from "./logger";
|
||||
import { UserNotLoggedInError } from "@shared";
|
||||
import { omit } from "lodash-es";
|
||||
|
||||
interface HydraApiOptions {
|
||||
needsAuth: boolean;
|
||||
|
@ -96,11 +97,14 @@ export class HydraApi {
|
|||
this.instance.interceptors.response.use(
|
||||
(response) => {
|
||||
logger.log(" ---- RESPONSE -----");
|
||||
const data = Array.isArray(response.data)
|
||||
? response.data
|
||||
: omit(response.data, ["username", "accessToken", "refreshToken"]);
|
||||
logger.log(
|
||||
response.status,
|
||||
response.config.method,
|
||||
response.config.url,
|
||||
response.data
|
||||
data
|
||||
);
|
||||
return response;
|
||||
},
|
||||
|
@ -166,7 +170,10 @@ export class HydraApi {
|
|||
this.userAuth.authToken = accessToken;
|
||||
this.userAuth.expirationTimestamp = tokenExpirationTimestamp;
|
||||
|
||||
logger.log("Token refreshed", this.userAuth);
|
||||
logger.log(
|
||||
"Token refreshed. New expiration:",
|
||||
this.userAuth.expirationTimestamp
|
||||
);
|
||||
|
||||
userAuthRepository.upsert(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue