refarctory auth.rb and fix render_not_found missing
refactory match route to reuse it