UNPKG

identity

Version:

Identity client

25 lines (22 loc) 635 B
exports.action = { name: 'logout', description: 'User logout', inputs: { 'required' : [], 'optional' : [] }, blockedConnectionTypes: [], outputExample: { success: true }, requireAuth: false, run: function(api, connection, next){ var res = connection.rawConnection.res; var url = api.identity.site + '/api/logout?client_id=' + api.config.identity.id; //redirect to identity server connection.rawConnection.responseHeaders.push(['Location', url]); connection.rawConnection.responseHttpCode = 307; connection.session.__destroy = true; next(connection, true); } };