waiting-for-dev / devise-jwt

JWT token authentication with devise and rails
MIT License
1.25k stars 129 forks source link

Devise Resource not Authenticated #242

Closed ror-vs closed 2 years ago

ror-vs commented 2 years ago

I am using devise-jwt gem for token-based authentication for multiple resources. The problem that I am facing is that, even without providing the emails and password for the resource, the resource is logged in without authenticating.

Expected behavior

the resource should be authenticated before login

Actual behavior

the resource is logged in without authentication

In devise.rb initializer I have image

in my routes i have

image image image

My session controllers for the resources are as follows:

image image

Here is a snap from the login api where password is not provided but it has logged in th client

image

waiting-for-dev commented 2 years ago

Probably related to https://github.com/waiting-for-dev/devise-jwt#session-storage-caveat

ror-vs commented 2 years ago

Probably related to https://github.com/waiting-for-dev/devise-jwt#session-storage-caveat

it worked. Thanks

ror-vs commented 2 years ago

is there a way we can create the custom token for the resources which are not being created from devise? my test case is I am decoding the info from google token and then saving it backend. is it possible to create a token for it?

waiting-for-dev commented 2 years ago

No, this is an extension for Devise. Probably you'll need to manually do something with https://github.com/jwt/ruby-jwt