feathers-authentication

Logout using FeathersJS REST API

狂风中的少年 提交于 2021-01-07 01:53:12
问题 Using freshly generated FeathersJS application (local auth), I am doing following REST api calls with following behaviour: GET /users - it FAILS with not-authorized POST /authentication with username and password - successful GET /users - it SUCCEEDS and returns list of users DELETE /authentication - returns auth object, no error messages (and on server side logout event is generated) GET /users - it SUCCEEDS and returns list of users expected result from my side is that on step 5 I would get

Logout using FeathersJS REST API

落爺英雄遲暮 提交于 2021-01-07 01:52:07
问题 Using freshly generated FeathersJS application (local auth), I am doing following REST api calls with following behaviour: GET /users - it FAILS with not-authorized POST /authentication with username and password - successful GET /users - it SUCCEEDS and returns list of users DELETE /authentication - returns auth object, no error messages (and on server side logout event is generated) GET /users - it SUCCEEDS and returns list of users expected result from my side is that on step 5 I would get

How to add a users auth in feathers middleware?

寵の児 提交于 2020-12-14 12:06:19
问题 I use feathersjs framework in my projekt. In older version my middleware it was work but afer update a framework and after created new app with authenticate a middleware not working. My index.js file show like below: const cookieParser = require('cookie-parser'); const { authenticate } = require('@feathersjs/express'); module.exports = function (app) { app.get('/login', (req, res) => { res.sender('login'); }); app.use('/', cookieParser(), authenticate('jwt'), async (req, res) => { const {

How to add a users auth in feathers middleware?

主宰稳场 提交于 2020-12-14 12:04:05
问题 I use feathersjs framework in my projekt. In older version my middleware it was work but afer update a framework and after created new app with authenticate a middleware not working. My index.js file show like below: const cookieParser = require('cookie-parser'); const { authenticate } = require('@feathersjs/express'); module.exports = function (app) { app.get('/login', (req, res) => { res.sender('login'); }); app.use('/', cookieParser(), authenticate('jwt'), async (req, res) => { const {

How to add a users auth in feathers middleware?

冷暖自知 提交于 2020-12-14 12:00:58
问题 I use feathersjs framework in my projekt. In older version my middleware it was work but afer update a framework and after created new app with authenticate a middleware not working. My index.js file show like below: const cookieParser = require('cookie-parser'); const { authenticate } = require('@feathersjs/express'); module.exports = function (app) { app.get('/login', (req, res) => { res.sender('login'); }); app.use('/', cookieParser(), authenticate('jwt'), async (req, res) => { const {

User's permissions in feathers.js API

非 Y 不嫁゛ 提交于 2019-12-24 22:28:09
问题 I'm trying to create some REST API with user roles like admin, superadmin etc. I was trying to achieve this by using feathers-permissions module, but there are none working examples and the internet. Have you ever dealt with such task? What I do now is: feathers generate app and then feathers generate authentication . What should I do next? 回答1: The secret to implementing permissions and roles in Feathers is that Hooks really provide everything you need with all the flexibility you might want

How can I set the `sub` claim of a JWT in FeathersJS?

送分小仙女□ 提交于 2019-12-07 18:59:44
问题 The sub claim for JWTs is optional, but the feathersjs-authentication won't let me set it to a blank string or remove it. I was able to add a new value to the payload in the authentication before hook but changing sub or trying to remove it doesn't work. app.service('/api/auth').hooks({ before: { create: [ // You can chain multiple strategies auth.hooks.authenticate(['jwt', 'local']), hook => { // I can add a new `SUB` value but this method doesn't work for `sub` Object.assign(hook.params