<?php
	namespace Main\Middlewares;
	
  use Pecee\Http\Middleware\IMiddleware;
	use Pecee\Http\Request;
	
	class EmailNullCheckMiddleware implements IMiddleware {
		
		public function handle(Request $request): void
		{
			if (auth()->check() && (auth()->user()->email() == null || auth()->user()->email() == "" || auth()->user()->email() == "your@email.com")) {
				$request->setRewriteUrl(url('auth.email'));
			}
		}
	}