vendor/cache/ruby/2.3.0/gems/warden-github-1.3.2/lib/warden/github/strategy.rb
# The first time this is called, the flow gets set up, stored in the
# session and the user gets redirected to GitHub to perform the login.
#
# When this is called a second time, the flow gets evaluated, the code
# gets exchanged for a token, and the user gets loaded and passed to
# warden.
#
# If anything goes wrong, the flow is aborted and reset, and warden gets
# notified about the failure.
#
# Once the user gets set, warden invokes the after_authentication callback
# that handles the redirect to the originally requested url and cleans up
# the flow. Note that this is done in a hook because setting a user
# (through #success!) and redirecting (through #redirect!) inside the
# #authenticate! method are mutual exclusive.
The first time this is called, the flow gets set up, stored in the
session and the user gets redirected to GitHub to perform the login.

When this is called a second time, the flow gets evaluated, the code
gets exchanged for a token, and the user gets loaded and passed to
warden.

If anything goes wrong, the flow is aborted and reset, and warden gets
notified about the failure.

Once the user gets set, warden invokes the after_authentication callback
that handles the redirect to the originally requested url and cleans up
the flow. Note that this is done in a hook because setting a user
(through #success!) and redirecting (through #redirect!) inside the
authenticate. method are mutual exclusive.
The first time this is called the flow gets set up stored in the session and the user gets redirected to GitHub to perform the login . When this is called a second time the flow gets evaluated the code gets exchanged for a token and the user gets loaded and passed to warden . If anything goes wrong the flow is aborted and reset and warden gets notified about the failure . Once the user gets set warden invokes the after_authentication callback that handles the redirect to the originally requested url and cleans up the flow . Note that this is done in a hook because setting a user ( through #success! ) and redirecting ( through #redirect! ) inside the authenticate . method are mutual exclusive .
def authenticate!
        if in_flow?
          continue_flow!
        else
          begin_flow!
        end
      end
def authenticate! if in_flow? continue_flow! else begin_flow! end end
The first time this is called, the flow gets set up, stored in the
session and the user gets redirected to GitHub to perform the login.
The first time this is called the flow gets set up stored in the session and the user gets redirected to GitHub to perform the login .