MCPcopy Create free account
hub / github.com/coderwhy/coderhub / AuthService

Class AuthService

src/service/auth.service.js:3–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1const connection = require('../app/database');
2
3class AuthService {
4 async checkResource(tableName, id, userId) {
5 const statement = `SELECT * FROM ${tableName} WHERE id = ? AND user_id = ?;`;
6 const [result] = await connection.execute(statement, [id, userId]);
7 return result.length === 0 ? false: true;
8 }
9}
10
11module.exports = new AuthService();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected