Skip to content

Instantly share code, notes, and snippets.

@bryanp
Created January 20, 2012 02:45
Show Gist options
  • Select an option

  • Save bryanp/1644634 to your computer and use it in GitHub Desktop.

Select an option

Save bryanp/1644634 to your computer and use it in GitHub Desktop.
pakyow-auth control flow
# this would happen if auth fails (in Auth#create_session)
begin
throw :auth_fail, true
rescue ArgumentError
# uncaught, so do redirect etc
end
# and this would be the code in the app that implements pakyow-auth
if catch(:auth_fail) {
Auth.new_session
}
# handle auth failure
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment