Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. localhost:3000/phones?user_email=prashanth.pola560@gmail.com&user_token=dkiR3-QVBYz1ty8x3BAQ
  2.  
  3. Started GET "/phones?user_email=prashanth.pola560@gmail.com&user_token=dkiR3-QVBYz1ty8x3BAQ" for 127.0.0.1 at 2017-07-08 17:42:10 +0530
  4. Processing by PhonesController#index as HTML
  5. Parameters: {"user_email"=>"prashanth.pola560@gmail.com", "user_token"=>"dkiR3-QVBYz1ty8x3BAQ"}
  6. Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)
  7.  
  8.  
  9. Started GET "/users/sign_in" for 127.0.0.1 at 2017-07-08 17:42:10 +0530
  10. Processing by Devise::SessionsController#new as HTML
  11. Rendering /home/prashanth/.gems/gems/devise-4.3.0/app/views/devise/sessions/new.html.erb within layouts/application
  12. Rendered /home/prashanth/.gems/gems/devise-4.3.0/app/views/devise/shared/_links.html.erb (1.0ms)
  13. Rendered /home/prashanth/.gems/gems/devise-4.3.0/app/views/devise/sessions/new.html.erb within layouts/application (4.4ms)
  14. Completed 200 OK in 26ms (Views: 25.4ms | ActiveRecord: 0.0ms)
  15.  
  16. class ApplicationController < ActionController::Base
  17. protect_from_forgery with: :exception
  18. acts_as_token_authentication_handler_for User
  19. end
  20.  
  21. class User < ApplicationRecord
  22. # Include default devise modules. Others available are:
  23. # :confirmable, :lockable, :timeoutable and :omniauthable
  24. devise :database_authenticatable, :registerable,
  25. :recoverable, :rememberable, :trackable, :validatable
  26. acts_as_token_authenticatable
  27. end
  28.  
  29. class PhonesController < ApplicationController
  30. before_action :set_phone, only: [:show, :edit, :update, :destroy]
  31. before_action :authenticate_user!
  32. # GET /phones
  33. # GET /phones.json
  34. def index
  35. @phones = Phone.all
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement