Skip to content

Instantly share code, notes, and snippets.

@sys1yagi
Created June 22, 2017 04:31
Show Gist options
  • Save sys1yagi/c6348ccb3e4f0042cd15b3687bda1bad to your computer and use it in GitHub Desktop.
Save sys1yagi/c6348ccb3e4f0042cd15b3687bda1bad to your computer and use it in GitHub Desktop.
@startuml

start

if (Have an access token?) then (yes)
else (no)
  if (Have an refresh token?) then (yes)
    while (Request access token) is (error)
      if (retry?) then (yes)
      else (no)
        :Auth Error;
        stop
      endif
    endwhile (success)
  else (no)
    :Auth Error;
    stop
  endif
endif
:Request;
if (succeed?) then (yes)
  :response;
  stop
else (no)
  if (401?) then (yes)
    :Auth Error;
  else (no)
    :Request Error;
  endif
stop
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment