From 23b3fb81f9989480f9146fe8b937726950db3697 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 28 Feb 2024 10:43:19 +0100 Subject: [PATCH] refs 6930 feat: implements logout remoteMethod --- back/models/vn-user.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/back/models/vn-user.js b/back/models/vn-user.js index b59f13ffa..473e619db 100644 --- a/back/models/vn-user.js +++ b/back/models/vn-user.js @@ -31,6 +31,32 @@ module.exports = function(Self) { message: `A client with that Web User name already exists` }); + Self.remoteMethod('logoutMultimedia', { + description: 'Logout current MultimediaToken', + accepts: [{ + arg: 'ctx', + type: 'Object', + http: {source: 'context'} + }], + returns: { + type: 'Boolean', + root: true + }, + http: { + verb: 'POST', + path: '/logoutMultimedia' + }, + accessScopes: ['read:multimedia'] + }); + Self.logoutMultimedia = async function(ctx) { + let {accessToken} = ctx.req; + try { + Self.logout(accessToken.id); + return true; + } catch (error) { + return error; + } + }; Self.remoteMethod('getCurrentUserData', { description: 'Gets the current user data', accepts: [