{"action":"closed","issue":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/471","repository_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth","labels_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/471/comments","events_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/471/events","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/471","id":122147246,"number":471,"title":"Unable to override sessions controller","user":{"login":"dgoradia","id":9560862,"avatar_url":"https://avatars2.githubusercontent.com/u/9560862?v=4","gravatar_id":"","url":"https://api.github.com/users/dgoradia","html_url":"https://github.com/dgoradia","followers_url":"https://api.github.com/users/dgoradia/followers","following_url":"https://api.github.com/users/dgoradia/following{/other_user}","gists_url":"https://api.github.com/users/dgoradia/gists{/gist_id}","starred_url":"https://api.github.com/users/dgoradia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgoradia/subscriptions","organizations_url":"https://api.github.com/users/dgoradia/orgs","repos_url":"https://api.github.com/users/dgoradia/repos","events_url":"https://api.github.com/users/dgoradia/events{/privacy}","received_events_url":"https://api.github.com/users/dgoradia/received_events","type":"User","site_admin":false},"labels":[{"id":711987648,"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/labels/close-in-7-days","name":"close-in-7-days","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2015-12-14T22:33:38Z","updated_at":"2017-10-14T14:39:55Z","closed_at":"2017-10-14T14:39:55Z","author_association":"NONE","body":"Or any controller. I really just need to override the render methods.\n\nFollowing from the readme under https://github.com/lynndylanhurley/devise_token_auth#custom-controller-overrides, it just isn't working for me.\n\n``` ruby\nRails.application.routes.draw do\n\n  mount_devise_token_auth_for 'User', at: 'auth', skip: [:sessions, :registrations, :passwords, :omniauth_callbacks]\n\n  namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do\n    scope module: :v1 do\n\n      # devise_for :users\n      mount_devise_token_auth_for 'User', at: 'auth', skip: [:token_validations],\n      controller: {\n        sessions: 'devise_token_auth/sessions'\n      }\n      ...\n```\n\napp/controllers/api/v1/devise_token_auth/sessions_controller.rb\n\n``` ruby\n  class Api::V1::SessionsController < DeviseTokenAuth::SessionsController\n\n    protected\n\n    def render_create_success\n      data = @resource.token_validation_response\n\n      role = Role.find(@resource.id)\n      data[:role] = role.name\n      render json: {\n        data: data\n      }\n    end\n\n  end\n```\n\nIt doesn't use this controller and just returns the default. Any suggestions would be appreciated!\n"}}
{"actor":{"display_login":"zachfeldman"}}