Created
January 20, 2012 02:45
-
-
Save bryanp/1644634 to your computer and use it in GitHub Desktop.
pakyow-auth control flow
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
| # 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