WiP updates
This commit is contained in:
parent
6706d93bc1
commit
4fce4b6f81
27 changed files with 763 additions and 85 deletions
|
@ -371,12 +371,12 @@ function registerRestrictedAccessTokenMethod(method, getHandlerFromParams) {
|
|||
restrictedAccessTokenMethods[method] = getHandlerFromParams;
|
||||
}
|
||||
|
||||
function getRestrictedAccessToken(context, method, params) {
|
||||
async function getRestrictedAccessToken(context, method, params) {
|
||||
const token = crypto.randomBytes(24).toString('hex').toLowerCase();
|
||||
const tokenEntry = {
|
||||
token,
|
||||
userId: context.user.id,
|
||||
handler: restrictedAccessTokenMethods[method](params),
|
||||
handler: await restrictedAccessTokenMethods[method](params),
|
||||
expires: Date.now() + 120 * 1000
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue