Skip to content

Commit

Permalink
Merge pull request #1006 from Heroes-Profile/AdFreeSiteFlairOverride
Browse files Browse the repository at this point in the history
Adds a manual override for ad free
  • Loading branch information
Zemill authored May 13, 2024
2 parents 47bb8b2 + 6a9a53d commit d01e503
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Middleware/CheckIfPatreonSupporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function handle(Request $request, Closure $next): Response
}
}

if($user->flair_adfree_override == 1){
session(['patreonSubscriberAdFree' => true]);
session(['patreonSubscriberSiteFlair' => true]);
}
}

return $next($request);
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Middleware/LogIPAndUserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cookie;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Support\Facades\Auth;
use App\Models\BattlenetAccount;

class LogIPAndUserAgent
{
Expand All @@ -17,6 +19,10 @@ class LogIPAndUserAgent
*/
public function handle(Request $request, Closure $next): Response
{

//$user = BattlenetAccount::find(1);
//Auth::login($user);

try {
Cookie::queue(Cookie::forget('additional-battletags'));
$ip = '';
Expand Down
1 change: 1 addition & 0 deletions app/Models/BattlenetAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class BattlenetAccount extends Authenticatable
'updated_at',
'created_at',
'private',
'flair_adfree_override',
];

public function patreonAccount()
Expand Down

0 comments on commit d01e503

Please sign in to comment.