Questions tagged [devise-token-auth]

Token-based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth. Use this tag for questions related to Devise Token Auth.

Token-based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth. Use this tag for questions related to Devise Token Auth.

136 questions
0
votes
0 answers

Is uid mandatory for devise token auth to find current user?

With default configuration of devise token auth, uid is identical to user’s email and is mandatory to find current user. But my requirement is that i need to hide uid in http header when request and response due to security risk. Is this possible?
0
votes
1 answer

Devise test helper fails to sign in

I have a rails API app using devise_token_auth and in my tests (minitest) I need to send POST requests and signed in users so I used the sign_in method but it doesn't seem to be doing anything. This is my test file require 'test_helper' class…
Qwertie
  • 5,784
  • 12
  • 45
  • 89
0
votes
1 answer

Rails5 API + devise_token_auth edit token format

so i'm using devise_token_auth gem for basic user functionalities, and I made some simple changes to the reset password flow. Basically instead of having a link in the email for the user to click and go to the reset page, I show the token, so the…
0
votes
1 answer

Custom sign_up route for devise-token-auth sign_up

I'm using the gem devise-token-auth which is working great. At this moment, for signing up I use the original routes which is /api/v1/auth in my case : # routes.rb namespace :api do namespace :v1 do mount_devise_token_auth_for 'User', as:…
ZazOufUmI
  • 3,212
  • 6
  • 37
  • 67
0
votes
1 answer

Rails 5.2 Auth - Token returned after create_new_auth_token

I am using devise_token_auth and I met a weird scenario. I have only one user in my database, and when I ask in the console for his tokens, I get this: $ user.tokens { "_5_Mh40SfQvsnkerykJMIw"=>{ …
Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189
0
votes
0 answers

Rails devise with devise_token_auth is not showing the login form

Hi Iam trying to use devise along with devise_token_auth. Initially my App was API only app. Hence we generated the app using --api flag. But after we need to add rails views for our admin functionality. As of now all the controllers are inherited…
Aditya Y
  • 198
  • 3
  • 13
0
votes
0 answers

Rails Devise_token_auth invalid_credentials: OAuth2::Error

I'm building an api a restful based rails 5, devise_token_auth and Omniauth google Oauth2. Currently basic account creation through email is working pretty well, Now I'm trying to configure Authentication with Google but during the authentication…
0
votes
1 answer

log in user right away after the user signs up

I am using devise token authentication(devise_token_auth) for user login and signup based on token because it is only for developing an api. I need to make the user logged in soon after the user registers his/her account. How can i do it so? I have…
Serenity
  • 3,884
  • 6
  • 44
  • 87
0
votes
1 answer

Rails Api with devise_token_auth gives "ActiveModel::ForbiddenAttributesError:

I want to build RailsAPI with facebook login, so I chose devise_token_auth. I followed the instruction and run rails g devise_token_auth:install User auth, my routes look like routes.rb Rails.application.routes.draw do mount_devise_token_auth_for…
0
votes
0 answers

Device token_authenticatable is not working with encrypted auth_tokens

We have recently encrypted all our auth_tokens in the users table. I have modified the authenticate_user_from_token! in ApplicationController to encrypt the params[:auth_token] before comparing in database. It fetches the user record and sign_in…
Saim
  • 2,471
  • 5
  • 30
  • 43
0
votes
1 answer

Passing Devise token in specs for Rails 5 API

I have a basic Rails API built with Accounts and Users. All of the account specs pass when I remove... before_action :authenticate_user! But with that in place, I'm having trouble getting the specs to pass. # Note `json` is a custom helper to parse…
phuzisham
  • 57
  • 1
  • 9
0
votes
1 answer

How to permit params to a specific devise_controller with devise_token_auth gem?

I'm using devise_token_authentication gem to build token based authentication rails api, then after that I added some extra fields to Vendor model through different migration, and in order to permit them I wrote this: class ApplicationController <…
MEH
  • 1,777
  • 3
  • 15
  • 34
0
votes
1 answer

ActiveAdmin with devise

I have a project using devise_token_auth for authentication. I have installed Active Admin following this. When I try to access localhost:3000/admin I get You need to sign in or sign up before continuing. However, when I comment…
-1
votes
1 answer

Oauth facebook with ruby on rails 5.2.5

Since two days i tried to make Login with Facebook on ruby on rails using devise but it returns me NULL as email's value. I read many articles on stackoverflow but a lot of them are from years ago and none have worked for me. Thanks you for…
-1
votes
1 answer

Allow multiple users with same email with Devise Token Auth

I'd like to allow multiple users with the same email to be created, using devise-token-auth. Rather than this error being thrown. @details={:email=>[{:error=>:taken, :value=>"testttt@gmail.com"}]}> I expected that removing devise :validatable from…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
1 2 3
9
10