1

This question was already answered here: Hook to check if user is authenticate in Feathers (without send Unauthorized error if not, just check) But supplied answer does not work for all cases.

Looks like that in Feathers v4 there is no more allowUnauthenticated option, as it was in v3:

  authenticate('jwt', {
    allowUnauthenticated: true
  })

But v4 anonymous authentication strategy does not work when you send an expired token.

If you configure hooks this way:

all: [ allowAnonymous(), authenticate('jwt', 'anonymous') ],

Anonymous strategy will not work if you send expired token and authenticate('jwt', 'anonymous') hook will respond with unauthorized error.

Eugene Mala
  • 1,081
  • 12
  • 25

0 Answers0