Closed beeplin closed 7 years ago
@beeplin yes you still need both registered on the server side to get the same functionality. This gives you more flexibility however because you can register multiple JWT and Local strategies with different options.
Local is for some version of username/password. JWT is for tokens. You can authenticate your app without using local and instead could use OAuth1/2, API key, SAML, whatever... or you could do like we do in the example app in this repo and just issue JWT access tokens when a user signs up.
From the clients perspective the way you authenticate is the exact same with the exception that type
is now strategy
. If you have already authenticated successfully and you call authenticate()
without anything it will attempt to authenticate with a stored JWT accessToken
.
Hope that answers your question.
In the old auth (0.7.x) when we use
type = 'lcoal'
, it initially verifies withemail
andpassword
and then depends on jwt payload (params.token
andparams.user
) to tell which user is logged in. If initially noemail
andpassword
provided, it will automatically use jwt token in localstorage to verify.Now in the new auth we have two pacakges, one
local
and onejwt
. Does that mean we have to use both the two to achieve the same functionality?