diff --git a/web/app/Http/Controllers/IndexController.php b/web/app/Http/Controllers/IndexController.php deleted file mode 100644 index 3a072ec..0000000 --- a/web/app/Http/Controllers/IndexController.php +++ /dev/null @@ -1,19 +0,0 @@ -view('auth.ddos_blocked', [], 403); + ->view('web.auth.ddos_blocked', [], 403); } public function store() diff --git a/web/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/web/app/Http/Controllers/Web/Auth/EmailVerificationNotificationController.php similarity index 94% rename from web/app/Http/Controllers/Auth/EmailVerificationNotificationController.php rename to web/app/Http/Controllers/Web/Auth/EmailVerificationNotificationController.php index 3362dca..7de5f4c 100644 --- a/web/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ b/web/app/Http/Controllers/Web/Auth/EmailVerificationNotificationController.php @@ -1,10 +1,10 @@ $request]); + return view('web.auth.reset-password', ['request' => $request]); } /** @@ -57,7 +57,7 @@ class NewPasswordController extends Controller // the application's home authenticated view. If there is an error we can // redirect them back to where they came from with their error message. return $status == Password::PASSWORD_RESET - ? redirect()->route('login')->with('status', __($status)) + ? redirect()->route('auth.login.index')->with('status', __($status)) : back()->withErrors(['status' => __($status)]); } } diff --git a/web/app/Http/Controllers/Auth/PasswordResetLinkController.php b/web/app/Http/Controllers/Web/Auth/PasswordResetLinkController.php similarity index 91% rename from web/app/Http/Controllers/Auth/PasswordResetLinkController.php rename to web/app/Http/Controllers/Web/Auth/PasswordResetLinkController.php index 667ab94..fc10057 100644 --- a/web/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ b/web/app/Http/Controllers/Web/Auth/PasswordResetLinkController.php @@ -1,10 +1,10 @@ expectsJson()) { - return route('login'); + return route('auth.login.index'); } } } diff --git a/web/app/Http/Middleware/DoubleSessionProtector.php b/web/app/Http/Middleware/DoubleSessionProtector.php index afbdf9b..165c57a 100644 --- a/web/app/Http/Middleware/DoubleSessionProtector.php +++ b/web/app/Http/Middleware/DoubleSessionProtector.php @@ -9,9 +9,9 @@ use App\Models\Session; class DoubleSessionProtector { protected function handlePage(Request $request, Closure $next) { - if($request->route()->getName() != 'ddos.bypass' && !$request->isMethod('post')) { + if(!str_starts_with($request->route()->getName(), 'auth.protection')) { return redirect() - ->to(route('ddos.bypass', ['ReturnUrl' => urlencode('/'.$request->path())]), 302); + ->to(route('auth.protection.index', ['ReturnUrl' => url()->full()]), 302); } return $next($request); @@ -39,13 +39,13 @@ class DoubleSessionProtector } } - if($request->route()->getName() == 'ddos.bypass') { + if(str_starts_with($request->route()->getName(), 'auth.protection')) { $returnUrl = $request->input('ReturnUrl'); if(!$returnUrl) - $returnUrl = '/'; + $returnUrl = route('home.landing'); - return redirect('/', 302); + return redirect(route('home.landing'), 302); } return $next($request); diff --git a/web/app/Models/User.php b/web/app/Models/User.php index 282eb9b..87168fa 100644 --- a/web/app/Models/User.php +++ b/web/app/Models/User.php @@ -6,6 +6,7 @@ use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use App\Notifications\ResetPasswordNotification; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable @@ -42,4 +43,17 @@ class User extends Authenticatable 'email_verified_at' => 'datetime', 'next_reward' => 'datetime', ]; + + /** + * Send a password reset notification to the user. + * + * @param string $token + * @return void + */ + public function sendPasswordResetNotification($token) + { + $url = route('auth.password.reset-submit', ['token' => $token]); + + $this->notify(new ResetPasswordNotification($url, $this)); + } } diff --git a/web/app/Notifications/ResetPasswordNotification.php b/web/app/Notifications/ResetPasswordNotification.php new file mode 100644 index 0000000..4d4a5dc --- /dev/null +++ b/web/app/Notifications/ResetPasswordNotification.php @@ -0,0 +1,66 @@ +token = $token; + $this->user = $user; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $title = 'Graphictoria Password Reset'; + + return (new MailMessage) + ->subject($title) + ->view('emails.password-reset', ['title' => $title, 'user' => $this->user->username, 'link' => $this->token]); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/web/app/Providers/RouteServiceProvider.php b/web/app/Providers/RouteServiceProvider.php index 5ddb67e..0a7894c 100644 --- a/web/app/Providers/RouteServiceProvider.php +++ b/web/app/Providers/RouteServiceProvider.php @@ -36,6 +36,7 @@ class RouteServiceProvider extends ServiceProvider // Route::domain(DomainHelper::TopLevelDomain()) ->middleware('web') + ->namespace('App\Http\Controllers\Web') ->group(base_path('routes/web.php')); // @@ -43,13 +44,15 @@ class RouteServiceProvider extends ServiceProvider // Route::domain('www.' . DomainHelper::TopLevelDomain()) ->middleware('web') + ->namespace('App\Http\Controllers\Web') ->group(base_path('routes/web.php')); // // Domain: api.gtoria.net // Route::domain('api.' . DomainHelper::TopLevelDomain()) - ->middleware('api') + ->middleware('web') + ->namespace('App\Http\Controllers\Api') ->group(base_path('routes/api.php')); }); } @@ -61,8 +64,6 @@ class RouteServiceProvider extends ServiceProvider */ protected function configureRateLimiting() { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); - }); + // } } diff --git a/web/resources/js/components/Feed.js b/web/resources/js/components/Feed.js new file mode 100644 index 0000000..8750046 --- /dev/null +++ b/web/resources/js/components/Feed.js @@ -0,0 +1,36 @@ +// © XlXi 2021 +// Graphictoria 5 + +import { useState, useRef } from 'react'; + +import Loader from './Loader'; + +const Feed = () => { + const inputRef = useRef(); + const submitRef = useRef(); + const feedRef = useRef(); + const [feedLoaded, setFeedLoaded] = useState(false); + + return ( + <> +
We've received your password reset request. Simply just click the button below to change your password.
+Reset Password ++ If you did not submit this request, you can ignore this email. +
+@endsection \ No newline at end of file diff --git a/web/resources/views/layouts/email.blade.php b/web/resources/views/layouts/email.blade.php new file mode 100644 index 0000000..497a685 --- /dev/null +++ b/web/resources/views/layouts/email.blade.php @@ -0,0 +1,42 @@ +@php + $slogan = (View::hasSection('description') ? View::getSection('description') . ' ' : '') . 'Graphictoria is an online social platform for those looking to relive the classic Roblox experience. So what are you waiting for? Join 8k+ other users in reliving the good ol\' days! Graphictoria is not affiliated with or sponsored by Roblox Corporation, all Roblox related indica and slogans belong to Roblox Corporation.'; + + $cssDriver = Storage::createLocalDriver(['root' => $_SERVER['DOCUMENT_ROOT'] . '/css']); +@endphp + + +Copyright © {{ \Carbon\Carbon::now()->format('Y') }} Graphictoria. All rights reserved.
+Graphictoria is not affiliated with, endorsed by, or sponsored by Roblox Corporation.
+Creating an account takes less than a minute, and you can join a community of 10k+ users for completely free.
Sign Up
Creating an account takes less than a minute, and you can join a community of 10k+ users for completely free.
Sign Up
By creating an account, you agree to our Terms of Service and our Privacy Policy.
diff --git a/web/resources/views/auth/reset-password.blade.php b/web/resources/views/web/auth/reset-password.blade.php similarity index 91% rename from web/resources/views/auth/reset-password.blade.php rename to web/resources/views/web/auth/reset-password.blade.php index 49f5846..372a19d 100644 --- a/web/resources/views/auth/reset-password.blade.php +++ b/web/resources/views/web/auth/reset-password.blade.php @@ -23,7 +23,7 @@ @endif -