mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 09:11:21 +10:00
Logging (#131)
* ci: pull version from package.json on build * fix: implicit any type * feat: inital support for logger * style: fix lint * feat: move more logging over to pino * fix: logging around company importing
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { AuthMec } from "~/prisma/client";
|
||||
import { OIDCManager } from "./oidc";
|
||||
import { logger } from "~/server/internal/logging";
|
||||
|
||||
class AuthManager {
|
||||
private authProviders: {
|
||||
@ -21,7 +22,7 @@ class AuthManager {
|
||||
};
|
||||
|
||||
constructor() {
|
||||
console.log("AuthManager initialized");
|
||||
logger.info("AuthManager initialized");
|
||||
}
|
||||
|
||||
async init() {
|
||||
@ -31,9 +32,9 @@ class AuthManager {
|
||||
if (!object) break;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(this.authProviders as any)[key] = object;
|
||||
console.log(`enabled auth: ${key}`);
|
||||
logger.info(`enabled auth: ${key}`);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
logger.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import objectHandler from "../../objects";
|
||||
import type { Readable } from "stream";
|
||||
import * as jdenticon from "jdenticon";
|
||||
import { systemConfig } from "../../config/sys-conf";
|
||||
import { logger } from "~/server/internal/logging";
|
||||
|
||||
interface OIDCWellKnown {
|
||||
authorization_endpoint: string;
|
||||
@ -206,7 +207,7 @@ export class OIDCManager {
|
||||
|
||||
return { user, options: session.options };
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
return `Request to identity provider failed: ${e}`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user