Last active
May 13, 2016 11:59
-
-
Save josemotanet/489250a2e1081516f68cf3a9abbbc4ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/users/sign_in" for ::1 at 2016-05-13 12:53:53 +0100 | |
Processing by Users::SessionsController#create as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"U8kDm/7mtjD7SiMAW0Mim95PyqnGSn/TROVdCfkkOEM2C8gSS8MOuOhDSe6yS+rXR4YBdtbXXNo26zr7zc7g6w==", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}, "commit"=>"Sign in"} | |
Can't verify CSRF token authenticity | |
Completed 422 Unprocessable Entity in 0ms | |
ActionController::InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken: | |
actionpack (4.2.6) lib/action_controller/metal/request_forgery_protection.rb:181:in `handle_unverified_request' | |
actionpack (4.2.6) lib/action_controller/metal/request_forgery_protection.rb:209:in `handle_unverified_request' | |
actionpack (4.2.6) lib/action_controller/metal/request_forgery_protection.rb:204:in `verify_authenticity_token' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:432:in `block in make_lambda' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:164:in `block in halting' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:504:in `block in call' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:504:in `call' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' | |
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action' | |
actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action' | |
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' | |
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument' | |
activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument' | |
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument' | |
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action' | |
actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action' | |
actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process' | |
actionview (4.2.6) lib/action_view/rendering.rb:30:in `process' | |
actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch' | |
actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' | |
actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action' | |
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch' | |
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve' | |
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve' | |
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve' | |
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call' | |
rack (1.6.4) lib/rack/etag.rb:24:in `call' | |
rack (1.6.4) lib/rack/conditionalget.rb:38:in `call' | |
rack (1.6.4) lib/rack/head.rb:13:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks' | |
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' | |
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' | |
airbrake (4.0.0) lib/airbrake/rails/middleware.rb:13:in `call' | |
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call' | |
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call' | |
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' | |
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app' | |
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call' | |
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged' | |
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged' | |
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged' | |
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call' | |
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets' | |
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call' | |
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' | |
rack (1.6.4) lib/rack/runtime.rb:18:in `call' | |
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' | |
rack (1.6.4) lib/rack/lock.rb:17:in `call' | |
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call' | |
rack (1.6.4) lib/rack/sendfile.rb:113:in `call' | |
airbrake (4.0.0) lib/airbrake/user_informer.rb:16:in `_call' | |
airbrake (4.0.0) lib/airbrake/user_informer.rb:12:in `call' | |
railties (4.2.6) lib/rails/engine.rb:518:in `call' | |
railties (4.2.6) lib/rails/application.rb:165:in `call' | |
rack (1.6.4) lib/rack/content_length.rb:15:in `call' | |
puma (3.4.0) lib/puma/configuration.rb:224:in `call' | |
puma (3.4.0) lib/puma/server.rb:569:in `handle_request' | |
puma (3.4.0) lib/puma/server.rb:406:in `process_client' | |
puma (3.4.0) lib/puma/server.rb:271:in `block in run' | |
puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.large-6.large-offset-3.columns | |
.user-form.user-form-signup | |
%h2 | |
= t('users.signin') | |
= form_tag user_session_path, method: :post do | |
%p | |
= label_tag 'email' | |
= email_field_tag 'user[email]', '', autofocus: true | |
%p | |
= label_tag 'password' | |
= password_field_tag 'user[password]' | |
%p | |
= submit_tag t('users.signin'), class: 'button expand' | |
%p | |
= link_to new_user_registration_path, class: 'button expand secondary' do | |
= t('users.signup') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::SessionsController < ApplicationController | |
layout 'users' | |
def new | |
end | |
def create | |
service = Services::Users::Signin.new(user_params).call | |
if service.ok? | |
session.store :access_token, service.access_token | |
session.store :client, service.client | |
session.store :uid, service.uid | |
session.store :name, service.name | |
redirect_to user_status_path, notice: t('services.users.sign_in.ok') | |
else | |
flash[:alert] = t('services.users.sign_in.fail') | |
@errors = service.errors | |
render :new | |
end | |
end | |
def destroy | |
service = Services::Users::Signout.new(*signout_params).call | |
end | |
# TODO: to be removed. Testing purposes only. | |
def status | |
render text: session | |
end | |
protected | |
def user_params | |
params.require(:user).permit(:email, :password).symbolize_keys | |
end | |
def signout_params | |
[session[:uid], session[:client], session[:access_token]] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
= title_tag('redacted') | |
= description_tag | |
= canonical_link_tag | |
= related_pages_link_tag | |
= stylesheet_link_tag '//fonts.googleapis.com/css?family=Montserrat' | |
= stylesheet_link_tag '//fast.fonts.net/cssapi/8d218c1c-ff57-4a4c-b011-c883544a8f62.css' | |
= stylesheet_link_tag 'http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css' | |
= stylesheet_link_tag :application, media: 'screen, projection' | |
= stylesheet_link_tag :users | |
= csrf_meta_tag | |
%body | |
#container | |
= render "flash" | |
= yield | |
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment