Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
dzdidi
2024-01-28 17:01:13 +00:00
parent e2cc611bc8
commit a0b2d1fc24
2 changed files with 3 additions and 24 deletions

View File

@@ -157,9 +157,9 @@ module.exports = class RPC {
return parsed
}
async authenticate (publicKey, req) {
if (!process.env.GIT_PEAR_AUTH) return publicKey
if (process.env.GIT_PEAR_AUTH === 'naitive') return publicKey
async authenticate (publicKey, request) {
if (!process.env.GIT_PEAR_AUTH) return publicKey.toString('hex')
if (process.env.GIT_PEAR_AUTH === 'naitive') return publicKey.toString('hex')
if (process.env.GIT_PEAR_AUTH !== 'naitive' && !request.header) {
throw new Error('You are not allowed to access this repo')
}