Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
180 views

How to get headers from Rails API with React JS using fetch?

I'm putting together a personal project that I need to login. the project is in react js and rails API. to login i am using devise. the devise by default when you login, it returns the access-token ...
Diogo Amaral's user avatar
0 votes
1 answer
166 views

How to enable "Remember Me" feature in gem devise_token_auth?

I'm using the gem devise_token_auth for authentication in my Ruby on Rails web application. I would like to know how to implement the "Remember Me" feature when using devise_token_auth. By ...
hunglt.ee's user avatar
1 vote
0 answers
82 views

ActionController::InvalidAuthenticityToken in Devise::RegistrationsController#create

I just installed devise and below is the specific error that I'm getting: Which is weird because I have <%= csrf_meta_tags %> inside the head tags of my application.html.erb file & <%= ...
Aly Dabbous's user avatar
1 vote
1 answer
781 views

Implement Devise token auth in existing rails app

I am working on a rails 7 app which has devise authentication running properly. I want to implement devise token auth in it. I have set up all the thing but devise token auth produces a migration file ...
Muhammad Ans's user avatar
0 votes
1 answer
154 views

Devise Auth Token

can anyone explain me what is the following line doing in DeviseAuthToken sign_in(:user, @resource, store: false, bypass: false. what is the function of store: false and bypass: false
Muhammad Ans's user avatar
1 vote
1 answer
1k views

Return authorization token with users credentials after sign in using devise-auth-token

I am using devise-auth-token. It is working perfectly. I want when a user is signed in, she/she should get authorization not only in header section but also with the user fields. Following are the ...
Muhammad Ans's user avatar
0 votes
1 answer
412 views

Devise Token Auth customised routes for additonal endpoints

I'm trying to setup custom routes for Devise_Token_Auth for additional endpoints for my User model. Here's my default devise_token_auth routes. mount_devise_token_auth_for 'User', at: 'auth' Now, I ...
Aftab Iqbal's user avatar
0 votes
1 answer
434 views

How can I refresh all the cookies, token and session after logout calling API using Rails Hotwire

I am working on a project which is done in Rails Hotwire where devise gem has been used for authentication and, in frontend Stimulus.js has been used. Instead of using link_to , I want to write an API ...
RABEYA KHATUN MUNA's user avatar
0 votes
1 answer
351 views

Devise does not valdiate email while sign_up

I have a model, User: class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :trackable include DeviseTokenAuth::...
Anas Ansari's user avatar
1 vote
0 answers
117 views

Add custom routes to devise returns 404 ActionNotFound

I would like to create a new routes and method inside my Sessions Controller within Devise. I am using devise_token_auth Here is my original routes.rb for devise : namespace :api do namespace :v1 ...
SJU's user avatar
  • 3,262
3 votes
0 answers
746 views

How to configure Rails API to use cookies for web clients and tokens for mobile apps?

I'm developing a Rails app (with Devise) to expose an API to be consumed by both web clients (React SPA) and mobile clients (iOS and Android). For web clients I'd like to use cookie authentication to ...
Mike Vosseller's user avatar
0 votes
1 answer
887 views

Password reset email using Rails devise is not changed

Assumption I am sending an email to reset my password using devise token auth. I was able to send the email, but I am unable to change the email template. I have tried everything but could not solve ...
Beginner Professional's user avatar
1 vote
1 answer
186 views

How can I solve this issue for the login?

Hi Everyone I will appreciate if someone can help me with this error: I'm building a ruby on rails app using Devise Gem. --Error-- undefined method `...
Ibrahim MA's user avatar
1 vote
0 answers
1k views

ActionDispatch::Cookies::CookieOverflow occurs when trying to return relevant values using devise token auth

Assumption I'm using devise token auth in Rails, and when I try to return values related to user information created with devise token auth, I get a cookie over capacity error. If I use model name.all ...
Beginner Professional's user avatar
0 votes
0 answers
301 views

How to use ruby on rails devise completely passwordless?

In our system, we have a separate solution for authentication, and we do not want to use the devise's password verification functionality. Other than password verification, we want to rely on the ...
Anand Padiya's user avatar
0 votes
1 answer
799 views

Rails protect_from_forgery has not been defined

I'm new at rails so maybe this is so basic and that's why I couldn't find anything about it. But anyways I stuck at here and I need help. I updated a rails 4 application to rails 6 and when I try to ...
Kadir Kalkan's user avatar
0 votes
0 answers
196 views

How to show or where to find session/registration controller for devise token auth gem in RAILS?

I want to do something in the session controller when the user is using the sign_in method. Where to find the session sign_in controller for devise token auth gem in rails? Or is it even possible? ...
rjsnavarette's user avatar
-1 votes
1 answer
71 views

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 ...
Chaldrak's user avatar
3 votes
0 answers
361 views

What is the difference between using a gem like devise_token_auth and devise_jwt?

I have a rails api only application that I want to use devise for the authentication. I came across this decision and I want to know which one is better. Would it make sense for a high volume web ...
Steve G's user avatar
  • 63
1 vote
2 answers
438 views

DeviseTokenAuth in Rails Application

I am implementing a session in my Rails Application, and I'm using DeviseTokenAuth gem. I want to implement a scenario that If a user does not send a request from the Front-end in 15 minutes, then the ...
Adnan's user avatar
  • 195
3 votes
2 answers
1k views

How do i hookup a React button to authenticate with Devise Token Auth + OmniAuth

I'm having trouble connecting my Devise Token Auth with a token I get back from google in react. I'm using this package for the button: https://www.npmjs.com/package/react-google-login This is the ...
BelgoCanadian's user avatar
0 votes
2 answers
186 views

How to include user has_many association on sign in response from devise?

hope you guys are doing well, I have this User which has a has_many association with an Address model (User has_many addresses). How can I config devise to return all the user addresses at the sign in?...
Roger Peixoto's user avatar
1 vote
0 answers
499 views

Chatwoot, Session/Cookie issue, getting `current_user` on custom added Rails View even after logout from Vue side

https://www.chatwoot.com is open source chat solution provider app. Developed in Rails and Vuejs. It's using DeviseTokenAuth gem for authentication. I want the current_user to work on both Vue side ...
Hiren Bhalani's user avatar
1 vote
1 answer
371 views

How to send sign in info to frontend after successful Oauth2 authorization in devise_token_auth?

I'm using devise_token_auth for Email and Google Oauth2 based authentication(used omniauth-google-oauth2 gem for this). I've successfully managed to store sign in info of the user signing up/in ...
Masroor's user avatar
  • 1,574
1 vote
0 answers
616 views

devise token auth and devise duplication in controllers

I have put together a Rails 6 backend with Devise and Devise token auth and a frontend Angular Nativescript application which uses the API. Ref; Backend: https://github.com/map7/...
map7's user avatar
  • 5,116
1 vote
0 answers
713 views

JWT::DecodeError for sign_out with invalid token with devise-jwt

I am trying to rescue_from a JWT::DecodeError caused by an invalid token when signing out using devise. But it's not working. I keep getting a JWT::DecodeError. Sessions controller: class ...
Ruby's user avatar
  • 21
3 votes
1 answer
2k views

How we pass the headers inside swagger rspecs

I'm getting this error when I run the rspec Response body: {"success":false,"errors":["Invalid login credentials"]} here is my code path '/api/auth/validate_token' do ...
shikha's user avatar
  • 669
0 votes
1 answer
1k views

NameError (undefined local variable or method `sign_up_params' for #<RegistrationsController:0x0000000000f280>)

I have this error, it occurs when I try to POST the user, I can't understand, pls help me I don't know what else to do, I didn't find anything before doing this post, tks. My files: ...
user avatar
2 votes
1 answer
703 views

No route matches "omniauth/:provider" when using devise, omniauth and devise-token-auth

I'm trying to allow my users to login with their Google accounts using devise, omniauth and devise-token-auth. To do so I have added the following code to the rails API-only boilerplate. # Gemfile ......
Gumbee's user avatar
  • 63
0 votes
1 answer
614 views

DeviseToken Auth Not Receiving token/header data to logout

I am having an issue getting devise_token_auth logout working. I am working based on these SO: How to set header and options in axios? Why am I unable to sign out using devise_token_auth and curl? ...
user3738936's user avatar
0 votes
1 answer
441 views

Devise Token Auth - Not returning tokens to client

Setting up devise_token_auth. Keep running in to issues in the source code. Ex: def token_validation_response as_json(except: %i[tokens created_at updated_at]) end It will be called from: ...
user3738936's user avatar
0 votes
1 answer
476 views

Can't authenticate user by its token, Filter chain halted as :authenticate_user! rendered or redirected

I am trying to get current_user but non the user is authenticated by header on API request. Header include access-token, client and uid but it doesn't authenticate and shows following errors: For ...
SahSantoshh's user avatar
0 votes
0 answers
256 views

Devise Token Auth - Permanent token?

Is there a way to generate a permanent token with Devise Token Auth, aside from changing the token_lifespan setting? I have an user oriented api that requires login but I also need to set up the same ...
xSlok's user avatar
  • 599
2 votes
0 answers
730 views

Rails Devise Token Auth Reset Password Flow - How to deep link from 302 redirect

I am trying to implement a reset password flow with devise token auth gem: https://github.com/lynndylanhurley/devise_token_auth The end client will be a mobile device (e.g. iOS, Android). I am ...
Abhas Arya's user avatar
2 votes
1 answer
1k views

Rails with Devise Token Auth uninitialized constant Users

I am using rails with devise token auth. i want to implement omniauth but it keeps me asking uninitialized constant user routes.rb namespace :api, defaults: { format: :json } do scope :v1 do ...
Arif Ikhsanudin's user avatar
1 vote
2 answers
837 views

Extending Rails Application Controllers for Active Admin and devise_token_auth

I am trying to implement both devise_token_auth and Active Admin in my rails api back-end. There are pretty clear instructions on the devise_token_auth FAQ explaining how to implement the two together ...
dmanaster's user avatar
  • 587
-1 votes
1 answer
352 views

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@...
tim_xyz's user avatar
  • 13.2k
4 votes
1 answer
3k views

Devise token auth not returning token on sign in

I've followed the tutorials here and here. I can create a user and get a successful response from sign_in, but that sign in does not contain an access token to be used in future requests. Also I can ...
tim_xyz's user avatar
  • 13.2k
0 votes
1 answer
1k views

Devise token Auth response does not include manually generated header tokens

I had to implement my own confirmations_controller because I use cellphone instead of email. # controllers/verifications_controller.rb class VerificationsController < ApplicationController def ...
David's user avatar
  • 127
0 votes
1 answer
166 views

Auth headers not set using angular-token

I just started with an angular app using angular-token and a rails back-end with devise-token-auth, I have the next "on-submit" in a sign-in component: onSubmit() { this.output = null; ...
Fito's user avatar
  • 488
0 votes
2 answers
1k views

devise_token_auth with devise for non-devise routes

I'm trying to get devise + devise_token_auth to work together using the 'enable_standard_devise_support = true' and without the need to duplicate every controller one for web and one for API. I turn ...
map7's user avatar
  • 5,116
2 votes
0 answers
251 views

Customized hash for nested attributes errors in rails

I have addresses & phones associations against the user model which means that a user can have multiple addresses and multiple phones. I have to store 1 address and 1 phone at the time of signup ...
Uzair Nadeem's user avatar
0 votes
2 answers
287 views

DRY concepts in rails controllers

I'm working on my first rails api server. I've got a controller for my User model that looks as such: class UsersController < ApplicationController def index if current_user.admin? @...
Reuben Wilson's user avatar
0 votes
1 answer
516 views

Rails returning 401 Unauthorised for User Auth Flow - Rails, devise gem, Devise_token_auth gem

Giving my first go at linking my React Native front end to my rails API back end. To do this I'm working with a user authentication flow and more specifically, signing in (creating the user on the ...
James Stirrat's user avatar
0 votes
0 answers
358 views

Routing error upon overriding registrations controller in Rails API using devise token auth

I am trying to send a POST request (using Postman) to sign up a new user using devise token auth and I am overriding the registrations controller to enable my own JSON responses. I keep getting a ...
Ryan McClure's user avatar
0 votes
0 answers
40 views

How would I create JSON responses in Rails API Controller to be used in React Native after checking sign up parameters?

Setup : Front end => React Native Back end => Rails API Context: I'm trying to create a user authentication flow using devise & devise-token-auth. My routes and requests seem to be working in ...
Ryan McClure's user avatar
3 votes
1 answer
933 views

devise_token_auth forget password API shows Use POST /sign_in to sign in. GET is not supported error

Following this solution https://stackoverflow.com/a/47761138/7818637 I am designing forgot password flow APIs on rails where I am using devise_token_auth gem for authentication. 1. A POST call to ...
Uzair Nadeem's user avatar
0 votes
0 answers
763 views

How to force logout a user other then current_user using devise

I need to create a functionality at admin site which allow an admin to force_logout any user. I am using devise token based authentication and tried sign_out user method, It does not work.
Vishal's user avatar
  • 113
0 votes
1 answer
80 views

How do i open up API requests to my app with devise_token_auth?

I am using devise_token_auth in my rails app. I am looking to open up apis to my app using user specific tokens which would give them limited access to certain apis within my app. It should work ...
Venomoustoad's user avatar
  • 1,213
0 votes
1 answer
1k views

token lifespan is not working with devise auth token gem and devise in rails grape api

I have a rails-grape api application that has been authenticated with devise. Now I am trying to implement auto-session timeout with the apis. For that I have implemented the devise_auth_token gem. ...
Soumyadip Chakraborty's user avatar