mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-18 06:34:28 +01:00
20
src/acl/index.js
Normal file
20
src/acl/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function getId(data) {
|
||||
if (!process.env.GIT_PEAR_AUTH) return payload
|
||||
if (process.env.GIT_PEAR_AUTH === 'nip98') {
|
||||
const nip98 = require('./nip98')
|
||||
return nip98.getId(data)
|
||||
}
|
||||
}
|
||||
|
||||
async function getToken(payload) {
|
||||
if (!process.env.GIT_PEAR_AUTH) return userId
|
||||
if (process.env.GIT_PEAR_AUTH === 'nip98') {
|
||||
const nip98 = require('./nip98')
|
||||
return nip98.getToken(payload)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getId,
|
||||
getToken
|
||||
}
|
||||
Reference in New Issue
Block a user