Now in the manager, when logging in with the client's apikey, the listing only shows the instance corresponding to the provided apikey (only with MongoDB)

This commit is contained in:
Davidson Gomes
2024-05-23 11:30:47 -03:00
parent 395b81a6ac
commit 2fcb476c50
5 changed files with 59 additions and 13 deletions

View File

@@ -68,6 +68,20 @@ export class AuthRepository extends Repository {
}
}
public async findByKey(key: string): Promise<AuthRaw> {
try {
this.logger.verbose('finding auth');
if (this.dbSettings.ENABLED) {
this.logger.verbose('finding auth in db');
return await this.authModel.findOne({ apikey: key });
}
return {};
} catch (error) {
return {};
}
}
public async list(): Promise<AuthRaw[]> {
try {
if (this.dbSettings.ENABLED) {