mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-09-01 01:35:10 +00:00
overrode error message for 403 code to show elegant message for the user.
This commit is contained in:
parent
305dc5d1e6
commit
39fcd109bb
2 changed files with 7 additions and 2 deletions
|
@ -62,7 +62,11 @@ class MailActions extends Actions
|
||||||
|
|
||||||
public static function editEmailSettings(string $token)
|
public static function editEmailSettings(string $token)
|
||||||
{
|
{
|
||||||
$response = LBRY::emailStatus($token);
|
list($status, $headers, $response) = LBRY::emailStatus($token);
|
||||||
|
if( $status == 403){
|
||||||
|
//Catch 403 to return elegant error message.
|
||||||
|
$response['error'] = "This email link is invalid. If you clicked this from an older email it may have been expired for security purposes. Please email help@lbry.io for a valid one.";
|
||||||
|
}
|
||||||
$responseData = $response['data'] ?? [];
|
$responseData = $response['data'] ?? [];
|
||||||
return ['mail/settings', [
|
return ['mail/settings', [
|
||||||
'emails' => $responseData['emails'] ?? [],
|
'emails' => $responseData['emails'] ?? [],
|
||||||
|
|
3
lib/thirdparty/LBRY.class.php
vendored
3
lib/thirdparty/LBRY.class.php
vendored
|
@ -32,7 +32,8 @@ class LBRY
|
||||||
|
|
||||||
public static function emailStatus($token)
|
public static function emailStatus($token)
|
||||||
{
|
{
|
||||||
return Curl::post(static::getApiUrl('/user/email/status'),['auth_token' => $token], ['json_response' => true]);
|
list($status, $headers, $body) = Curl::doCurl(Curl::POST, static::getApiUrl('/user/email/status'),['auth_token' => $token], ['json_response' => true]);
|
||||||
|
return array($status,$headers,$body);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function applyTags($type, $token, $tags)
|
public static function applyTags($type, $token, $tags)
|
||||||
|
|
Loading…
Add table
Reference in a new issue