Nejdet Kadir Bektaş

Joined

300 Experience
2 Lessons Completed
0 Questions Solved

Activity

Hi huys! I have an problem with devise-jwt gem. I have an default rails application. I want to use devise gem for normal authentication and api authentication with devise-jwt gem. But they can not running at the same time on my application.
this is for normal authentication:

Rails.application.routes.draw do

devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations',
}

# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root to:'welcome#index'
end

but i want to use devise gem with API endpoints like this:

Rails.application.routes.draw do
namespace :api do
namespace :v1 do
scope 'users', module: 'users', defaults: { format: :json } do
devise_scope :user do
post '/login', as: :user_session, to: 'sessions#create'
delete '/logout', as: :destroy_user_session, to: 'sessions#destroy'
post '/signup', as: :user_registration, to: 'registrations#create'
end
end
end
end

devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations',
}

# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root to:'welcome#index'
end

It is working but Authorization header is not being returned when sign in or sign up process

How do I inregration any theme with gem for example gem 'coreui-rails' in rails 6