added oauth refresh token support

This commit is contained in:
Danny Coates 2020-07-24 18:11:50 -07:00
parent ce507c557f
commit f3a1fde07f
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
9 changed files with 120 additions and 32 deletions

View file

@ -41,13 +41,20 @@ module.exports = function(ws, req) {
? config.max_downloads
: config.anon_max_downloads;
if (config.fxa_required && !user) {
ws.send(
JSON.stringify({
error: 401
})
);
return ws.close();
}
if (
!metadata ||
!auth ||
timeLimit <= 0 ||
timeLimit > maxExpireSeconds ||
dlimit > maxDownloads ||
(config.fxa_required && !user)
dlimit > maxDownloads
) {
ws.send(
JSON.stringify({