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
1
vote
1 answer

How to turn off CSRF-token check when using gem devise_token_auth

I am trying to turn off the CSRF-token check in a Rails app (used as API), since I want to handle authentication with the gem devise_token_auth I made aware my User.rb model about the new form of authentication: class User < ActiveRecord::Base …
AlbertMunichMar
  • 1,680
  • 5
  • 25
  • 49
1
vote
0 answers

Why fetch from React Native to Nginx + Phusion Passenger + Rails 5 with devise-token-auth, just response 401?

I could configure an Nginx-Passenger-Rails5 and deploy with Capistrano with this tutorial https://gorails.com/deploy/ubuntu/18.04#nginx-passenger for my API. After trying with Postman and httpie seems to work, the only problem is that I have an App…
1
vote
0 answers

uninitialized constant Devise (NameError) unicorn

I deployed my rails app with capistrano to digitalocean and after adding new gem gem 'devise_token_auth', '1.0.0' after deploying I faced strange issue in unicorn log. It is bellow E, [2019-05-09T17:49:37.285001 #19550] ERROR -- : uninitialized…
a.kozubenko
  • 1,030
  • 3
  • 15
  • 24
1
vote
1 answer

How to register user in devise with active record association?

I'm doing experiment using rails and devise_token_auth for authentication. I successfully create a new user for devise_token_auth. I already search this in google or here in this forum but I can't find a solid documention on how going to do it. But…
user3818576
  • 2,979
  • 8
  • 37
  • 62
1
vote
0 answers

Why devise_token_auth break vanilla devise routes?

I am using devise and devise_token_auth in my Rails5 app. Devise omniauth ( facebook/google ) for web and devise_token_auth for mobile app. i defined routes with: scope module: 'api' do namespace :v1 do mount_devise_token_auth_for 'User', at:…
1
vote
2 answers

Adding extra fields to devise token auth user sign up

I have a signup form for devise-token-auth. I would like users to enter a username as well on the signup form. The username column exists in the database but the controller rejects it Unpermitted parameter: :username How can I extend the permitted…
Qwertie
  • 5,784
  • 12
  • 45
  • 89
1
vote
0 answers

Signin into electron app from browser window

I have electron app which uses Angular-Token for Angular and Devise Token Auth for rails backend. Oauth sign in works fine in browser using api provided by Angular-Token. It creates a new window and returns an observable and window closes after…
1
vote
1 answer

Accessing new access-token upon reload from redux-token-auth

I am building a web application consists of a React frontend and a couple of Rails APIs in the backend. One Rails API is for user authentication and the other is for storage, and all of this is coordinated through resftful API endpoints. For the…
1
vote
1 answer

devise auth token current_user return nil

I want acsess to current_user in devise aoth token gem but its return nil or error : "You need to sign in or sign up before continuing." I use redux-token-auth package for client side , and client side do login and register user successfully But in…
1
vote
2 answers

error on after upgrading ruby from 2.3 to 2.4.4

I have updated my ruby version for a project and now getting following error. I am using devise token auth for authentication my session creation is working fine and code is still running with older ruby version what I need to do to make it run for…
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49
1
vote
1 answer

Does devise_token_auth use JSON web tokens?

I am creating a new SPA with a REST API and for the backend I am using Rails with devise_token_auth. I am new to token authentication and while searching I am seeing a lot of libraries for frontend libraries that support JWT but I can't tell if this…
Qwertie
  • 5,784
  • 12
  • 45
  • 89
1
vote
0 answers

devise token auth doesn't return access-token with React

I am moving an application from using devise to devise token auth. I have added the gem, set up everything, etc. My issue lies in the fact that when I make a request from React (using axios) to the backend it returns the user (as it should), but…
Mike Riley
  • 282
  • 3
  • 20
1
vote
0 answers

devise_token_auth in rails 5 API: Completed 422 Unprocessable Entity

I have a Rails 5 API project with devise_token_auth gem installed. I also have a vue project using jtoker to aunthenticate to the rails api. Everytime I send a request from the vue application to register a user I get Completed 422 Unprocessable…
1
vote
1 answer

devise_token_auth undefined method 'create_token' issue

In my rails 5 application I have used "devise_token_auth" gem for developing token based API's for authentication purpose. Till date everything was working good, but suddenly I am getting below error, NoMethodError (undefined method `create_token'…
Hemant Patil
  • 331
  • 2
  • 18
1
vote
1 answer

devise_token_auth: how to sign in a user after signup?

I have successfully migrated to devise_token_auth (from simple_token_authentication), however for UX reasons I'd like to allow a user to sign up for their account, use their account immediately (previously done by returning a token in the signup…
mycellius
  • 568
  • 1
  • 5
  • 28