Guest User

Untitled

a guest
Feb 11th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. before_filter :request_confirm, :only => [:delete_device]
  2.  
  3. def request_confirm
  4.  
  5. user = User.find_by_id(session[:user_id])
  6.  
  7. authenticate_or_request_with_http_basic do |nick, pass|
  8. nick == user.nickname and pass == user.password
  9. end
  10.  
  11. end
  12.  
  13. authenticate_or_request_with_http_basic do |nick, pass|
  14. nick == user.nickname and pass == user.password
  15. end
  16.  
  17. def authenticate_or_request_with_http_basic(realm = "Application", &login_procedure)
  18. authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm)
  19. end
Add Comment
Please, Sign In to add comment