mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
Merge pull request #475 from lbryio/fix/youtube_redirects_error_and_index
Add redirect with if youtube token is invalid and also fix an index invalid bug
This commit is contained in:
commit
1edba56551
2 changed files with 17 additions and 5 deletions
|
@ -30,9 +30,13 @@ class AcquisitionActions extends Actions
|
||||||
|
|
||||||
public static function executeYouTube()
|
public static function executeYouTube()
|
||||||
{
|
{
|
||||||
|
if(isset($_GET['error_message'])){
|
||||||
|
$error_message = Request::encodeStringFromUser($_GET['error_message']);
|
||||||
|
}
|
||||||
|
|
||||||
return ['acquisition/youtube', [
|
return ['acquisition/youtube', [
|
||||||
'reward' => LBRY::youtubeReward(),
|
'reward' => LBRY::youtubeReward(),
|
||||||
'error_message' => Request::encodeStringFromUser($_GET['error_message']) ?? null
|
'error_message' => $error_message ?? ''
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,10 +52,18 @@ class AcquisitionActions extends Actions
|
||||||
|
|
||||||
public static function executeYoutubeStatus(string $token)
|
public static function executeYoutubeStatus(string $token)
|
||||||
{
|
{
|
||||||
|
if(isset($_GET['error_message'])){
|
||||||
|
$error_message = Request::encodeStringFromUser($_GET['error_message']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = LBRY::statusYoutube($token);
|
||||||
|
if ($data['success'] == false){
|
||||||
|
Controller::redirect('/youtube?error=true&error_message=' . $data['error']);
|
||||||
|
}
|
||||||
return ['acquisition/youtube_status', [
|
return ['acquisition/youtube_status', [
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'status_token' => LBRY::statusYoutube($token),
|
'status_token' => $data,
|
||||||
'error_message' => Request::encodeStringFromUser($_GET['error_message']) ?? null
|
'error_message' => $error_message ?? ''
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="blocks">
|
<div class="blocks">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<p>Your Sync Status<br>
|
<p>Your Sync Status<br>
|
||||||
|
@ -101,4 +101,4 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Add table
Reference in a new issue