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
18
votes
1 answer

Issue with devise_token_auth and logging in with Facebook?

I'm using devise and devise_token_auth along side each other. I have an Ionic 2 application that I'm attempting to login via Facebook with. Right now, the email/password authentication is working fine. Here's some of my code. #…
SeanWM
  • 16,789
  • 7
  • 51
  • 83
18
votes
1 answer

ng-token-auth, ionic, devise_token_auth; token get lost randomly in xhr request

I have inherited a Ionic app which uses ng-token-auth+devise_token_auth to handle the authentication and the session between front and back. What happens is quite strange. Sometimes (specially with slow connections) the request (or the response) get…
11
votes
1 answer

devise_token_auth with multiple models and auth headers

This is my problem, I override the controllers for an User model: mount_devise_token_auth_for 'User', at: 'auth', controllers: { registrations: 'v1/authentication/registrations' sessions: 'v1/authentication/sessions' …
Armando
  • 940
  • 7
  • 16
9
votes
3 answers

NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8 by using Devise_token_auth rails gem is not working

NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8 I think it is a session method error of some sort I have an angular6 app for frontend and rails for backend, so the best option for me was to opt for…
Wilson Varghese
  • 127
  • 1
  • 7
6
votes
1 answer

devise vs. devise_token_auth: How to handle authentication for both a web app and API

I'm writing an application that will primarily be accessed via API, but will also have views for editing via web app. I would like to create a User model with authentication and authorization across both platforms. I'm having trouble understanding…
nao
  • 1,128
  • 1
  • 14
  • 37
4
votes
3 answers

Devise_token_auth conflicts?

Made a new API in rails 5 using default --api tag and installed devise_token_auth gem using command rails generate devise_token_auth:install User auth . On doing rake:db:migrate, I get this error undefined method 'devise' for User (call…
4
votes
1 answer

why devise is generating this format of confirmation URL?

devise keep on generating this format of confirmation URL http://something.com/users/confirmation/divyanshu-rawat?confirmation_token=CV3zV1wAWsb3RokHHEKN I don't know why it is not generating something like…
4
votes
1 answer

How to set up devise_token_auth and omniauth with redux-token-auth?

I'm using devise_token_auth with a Rails 5 API and a separate React/Redux app using redux-token-auth, attempting to allow users to login via Twitter OAuth (using omniauth-twitter). I have devise_token_auth mounted at /api/v1 as follows: 1 │…
Guy
  • 764
  • 1
  • 5
  • 18
4
votes
0 answers

Devise Token Auth Reset Password gives 401 Unauthorized error

I am building rails API using devise token auth gem for authentication using tokens. Whenever I try to reset a password by clicking Forget Password, the form appears to provide email, when email is given then reset link is given to the user and they…
shreejana
  • 391
  • 3
  • 20
4
votes
2 answers

Why am I unable to sign out using devise_token_auth and curl?

I'm using rails-api with devise_token_auth for authentication. I am able to sign in without issue via: curl -i http://localhost:3000/api/v1/auth/sign_in -F email="user@nowhere.org" -F password="password" However, sign out fails with a 404 and the…
user3006381
  • 2,735
  • 3
  • 23
  • 32
3
votes
2 answers

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 auth I'm trying to set…
3
votes
1 answer

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 confirm that tokens are being created and saved in…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
3
votes
1 answer

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 send a Password Reset Email URL:…
Uzair Nadeem
  • 745
  • 2
  • 8
  • 29
3
votes
1 answer

How to update account using PUT with devise_token_auth?

I'm using devise_token_auth gem in my Rails 5 API application. For testing all devise token routes i use Postman. When I try to update a user account using PUT method on route "https://localhost:3000/auth", I fill the body of request with…
2
votes
0 answers

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 avoid the problem of where to securely store the…
Mike Vosseller
  • 4,097
  • 5
  • 26
  • 28
1
2 3
9 10