Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
sample: Add authorization timeout code.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshSnider committed Apr 13, 2018
1 parent d62361f commit 29d2cfc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Binary file modified samples/InteractiveSample/InteractiveSample.cpp
Binary file not shown.
10 changes: 9 additions & 1 deletion samples/InteractiveSampleUWP/InteractiveSampleUWP/App.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ int authorize(std::string& authorization)
char refreshTokenBuffer[1024];
size_t refreshTokenLength = sizeof(refreshTokenBuffer);
err = interactive_auth_wait_short_code(CLIENT_ID, shortCodeHandle, refreshTokenBuffer, &refreshTokenLength);
if (err) return err;
if (err)
{
if (MIXER_ERROR_TIMED_OUT == err)
{
std::cout << "Authorization timed out, user never approved OAuth prompt.";
}

return err;
}

/*
* TODO: This is where you would serialize the refresh token for future use in a way that is associated with the current user.
Expand Down
10 changes: 9 additions & 1 deletion samples/InteractiveXboxSample/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ int authorize(std::string& authorization)
char refreshTokenBuffer[1024];
size_t refreshTokenLength = sizeof(refreshTokenBuffer);
err = interactive_auth_wait_short_code(CLIENT_ID, shortCodeHandle, refreshTokenBuffer, &refreshTokenLength);
if (err) return err;
if (err)
{
if (MIXER_ERROR_TIMED_OUT == err)
{
std::cout << "Authorization timed out, user never approved OAuth prompt.";
}

return err;
}

/*
* TODO: This is where you would serialize the refresh token for future use in a way that is associated with the current user.
Expand Down

0 comments on commit 29d2cfc

Please sign in to comment.