ruby on rails - Typus with existing devise model getting 401 unauthorized error -



ruby on rails - Typus with existing devise model getting 401 unauthorized error -

i'm new ruby on rails , have problem configuring typus devise.

i have rails rest app (built using rails_api) , uses devise authentication stuff. i'm working on new rails app supposed admin pages of rest app using typus. ultimately, aim have admin app access same database rest app have been built before while using existing devise model of rest app. however, maintain getting 401 unathorized message though user exists in database.

to precise, have devise model, account, in rest app , want utilize particular devise model devise model in admin app. copied model account (alongside other models) rest app new admin app, then, followed this configure typus utilize devise authentication without generating new devise model:

rails generate devise:install rails generate typus # config/initializers/typus.rb typus.setup |config| config.authentication = :devise config.user_class_name = "account" end # edit devise model: business relationship require 'typus/orm/active_record/instance_methods' class business relationship < activerecord::base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable include typus::orm::activerecord::instancemethods def locale ::i18n.locale end def role typus.master_role end end # routes.rb rails.application.routes.draw devise_for :accounts end # initializers/devise.rb # create secret_key same rest app's secret_key config.secret_key = 'identic-secret-key-with-rest-app'

when run server , tried sign in using existing user in database (user rest app) maintain saying 401 unauthorized in server console. there missed in configuration? or approach doable?

it worked if generate new devise model admin app.

you adding :confirmable in business relationship model when signup send confirmation mail service confirm email, if login without confirming throw unauthorized error.

ruby-on-rails ruby ruby-on-rails-4 devise typus

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -