Implemented register,login,logout with fortify
This commit is contained in:
parent
3e47676515
commit
b27e156f15
@ -42,5 +42,14 @@ class FortifyServiceProvider extends ServiceProvider
|
|||||||
RateLimiter::for('two-factor', function (Request $request) {
|
RateLimiter::for('two-factor', function (Request $request) {
|
||||||
return Limit::perMinute(5)->by($request->session()->get('login.id'));
|
return Limit::perMinute(5)->by($request->session()->get('login.id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Custom routes defined specifically
|
||||||
|
Fortify::registerView(function () {
|
||||||
|
return view('auth.register');
|
||||||
|
});
|
||||||
|
|
||||||
|
Fortify::loginView(function () {
|
||||||
|
return view('auth.login');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'home' => '/home',
|
'home' => '/dashboard',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
4
Web-Application/Fortify/package-lock.json
generated
4
Web-Application/Fortify/package-lock.json
generated
@ -5,11 +5,11 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"@tailwindcss/vite": "^4.1.4",
|
||||||
"axios": "^1.8.2",
|
"axios": "^1.8.2",
|
||||||
"concurrently": "^9.0.1",
|
"concurrently": "^9.0.1",
|
||||||
"laravel-vite-plugin": "^1.2.0",
|
"laravel-vite-plugin": "^1.2.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.1.4",
|
||||||
"vite": "^6.2.4"
|
"vite": "^6.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,11 +6,11 @@
|
|||||||
"dev": "vite"
|
"dev": "vite"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"@tailwindcss/vite": "^4.1.4",
|
||||||
"axios": "^1.8.2",
|
"axios": "^1.8.2",
|
||||||
"concurrently": "^9.0.1",
|
"concurrently": "^9.0.1",
|
||||||
"laravel-vite-plugin": "^1.2.0",
|
"laravel-vite-plugin": "^1.2.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.1.4",
|
||||||
"vite": "^6.2.4"
|
"vite": "^6.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||||
@source '../../storage/framework/views/*.php';
|
@source '../../storage/framework/views/*.php';
|
||||||
@source '../**/*.blade.php';
|
@source '../**/*.blade.php';
|
||||||
|
@import "tailwindcss";
|
||||||
|
@source "../views";
|
||||||
@source '../**/*.js';
|
@source '../**/*.js';
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
|
|||||||
15
Web-Application/Fortify/resources/views/app.blade.php
Normal file
15
Web-Application/Fortify/resources/views/app.blade.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
@vite('resources/css/app.css')
|
||||||
|
<title>Fortify Authentication</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
@yield('content')
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
52
Web-Application/Fortify/resources/views/auth/login.blade.php
Normal file
52
Web-Application/Fortify/resources/views/auth/login.blade.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
@extends('app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-[#0d1b2a] h-screen flex justify-center items-center">
|
||||||
|
<div
|
||||||
|
class="flex justify-center items-center p-4 flex-wrap shadow-lg rounded-xl login-form size-150 max-w-[500px] bg-[#1b263b] h-auto text-center">
|
||||||
|
<h1 class="w-full font-bold text-4xl text-[#e0e1dd]">Login Page</h1>
|
||||||
|
|
||||||
|
<div class="w-[90%] p-5">
|
||||||
|
<form method="POST" action="{{route('login')}}">
|
||||||
|
@csrf
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Email:</label>
|
||||||
|
<input wire:model.lazy='email' name="email" type="email" placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('email') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Password:</label>
|
||||||
|
<input wire:model.lazy='password' name="password" type="password" placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('password') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-left my-5 flex justify-start items-center">
|
||||||
|
<input type="checkbox" wire:model.lazy='remember' name="remember" placeholder="Enter your text"
|
||||||
|
class="accent-blue-500 w-4 h-4 rounded-md focus:outline-none transition ease-in-out border-none" />
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd] px-2">Remember me</label>
|
||||||
|
</div>
|
||||||
|
<div class="text-[#e0e1dd] flex justify-between">
|
||||||
|
<a wire:navigate href="{{route('password.request')}}"
|
||||||
|
class="cursor-pointer font-medium underline hover:opacity-85 transition duration-300 ease-in-out">Forgot
|
||||||
|
Password</a>
|
||||||
|
<a wire:navigate href="{{route('register')}}"
|
||||||
|
class="cursor-pointer font-medium underline hover:opacity-85 transition duration-300 ease-in-out">Register</a>
|
||||||
|
</div>
|
||||||
|
<div class="mt-8">
|
||||||
|
<button type="submit"
|
||||||
|
class="border border-[#e0e1dd] font-medium w-full p-2 rounded-md bg-[#e0e1dd] cursor-pointer hover:opacity-85 transition duration-300 ease-in-out text-black">Login</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="mt-4 flex justify-between items-center gap-4">
|
||||||
|
<button
|
||||||
|
class="border border-[#e0e1dd] text-[#e0e1dd] w-full p-2 rounded-md font-medium cursor-pointer hover:opacity-85 transition duration-300 ease-in-out hover:bg-[#e0e1dd] hover:text-[#1b263b]">With
|
||||||
|
Github</button>
|
||||||
|
<button
|
||||||
|
class="border border-[#e0e1dd] text-[#e0e1dd] w-full p-2 rounded-md font-medium cursor-pointer hover:opacity-85 hover:bg-[#e0e1dd] hover:text-[#1b263b] transition duration-300 ease-in-out">With
|
||||||
|
Facebook</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
@extends('app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-[#0d1b2a] h-screen flex justify-center items-center">
|
||||||
|
<div
|
||||||
|
class="flex justify-center items-center flex-wrap shadow-lg rounded-xl login-form size-150 max-w-[500px] bg-[#1b263b] h-auto text-center p-4">
|
||||||
|
<h1 class="w-full font-bold text-4xl text-[#e0e1dd] mt-3">Register Page</h1>
|
||||||
|
|
||||||
|
<div class="w-[90%] p-5">
|
||||||
|
<form method="POST" action="{{ route(name: 'register') }}">
|
||||||
|
@csrf
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Name:</label>
|
||||||
|
<input wire:model.lazy='name' name="name" type="text" placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('name') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Email:</label>
|
||||||
|
<input wire:model.lazy='email' name="email" type="email" placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('email') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Password:</label>
|
||||||
|
<input wire:model.lazy='password' name="password" type="password" placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('password') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-left my-5">
|
||||||
|
<label for="username" class="font-bold text-[#e0e1dd]">Confirm Password:</label>
|
||||||
|
<input wire:model.lazy='password_confirmation' name="password_confirmation" type="password"
|
||||||
|
placeholder="Enter your text"
|
||||||
|
class="w-full my-2 px-4 py-2 border border-[#e0e1dd] text-[#e0e1dd] rounded-md shadow-sm focus:outline-none" />
|
||||||
|
<p class="w-full text-red-500">@error('password_confirmation') {{ $message }} @enderror</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-8">
|
||||||
|
<button
|
||||||
|
class="border border-[#e0e1dd] font-medium w-full p-2 rounded-md bg-[#e0e1dd] cursor-pointer hover:opacity-85 transition duration-300 ease-in-out text-black">Register</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="mt-4 flex justify-between items-center gap-4">
|
||||||
|
<button
|
||||||
|
class="border border-[#e0e1dd] text-[#e0e1dd] w-full p-2 rounded-md font-medium cursor-pointer hover:opacity-85 transition duration-300 ease-in-out hover:bg-[#e0e1dd] hover:text-[#1b263b]">With
|
||||||
|
Github</button>
|
||||||
|
<button
|
||||||
|
class="border border-[#e0e1dd] text-[#e0e1dd] w-full p-2 rounded-md font-medium cursor-pointer hover:opacity-85 hover:bg-[#e0e1dd] hover:text-[#1b263b] transition duration-300 ease-in-out">With
|
||||||
|
Facebook</button>
|
||||||
|
</div>
|
||||||
|
<div class="text-[#e0e1dd] mt-4">
|
||||||
|
<a wire:navigate href="{{route('login')}}">
|
||||||
|
Already have an account?
|
||||||
|
<span
|
||||||
|
class="cursor-pointer font-medium underline hover:opacity-85 transition duration-300 ease-in-out">Login</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
36
Web-Application/Fortify/resources/views/dashboard.blade.php
Normal file
36
Web-Application/Fortify/resources/views/dashboard.blade.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
@extends('app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-[#0d1b2a] h-screen flex justify-center items-center space-x-4">
|
||||||
|
<aside class="bg-[#1b263b] h-screen w-[300px] rounded-xl flex flex-col justify-between p-5 text-white shadow-lg">
|
||||||
|
<div class="mt-5">
|
||||||
|
<div class="text-center mb-6">
|
||||||
|
<h1 class="font-bold text-3xl">Your Panel</h1>
|
||||||
|
<p class="text-gray-300 mt-1">You are logged in!</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav class="space-y-2">
|
||||||
|
<a href="#" class="block px-4 py-2 rounded-lg hover:bg-[#415a77] transition">👤 Profile</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6 space-y-4">
|
||||||
|
<form action="{{route('logout')}}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<button type="submit"
|
||||||
|
class="block cursor-pointer text-center w-full border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-all duration-300 rounded-lg py-2">Logout</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
|
||||||
|
<main class="h-screen w-full flex items-center justify-center bg-[#0d1b2a]">
|
||||||
|
<div class="bg-[#1b263b] p-8 rounded-xl shadow-xl max-w-[800px] w-full">
|
||||||
|
<h1 class="text-3xl font-semibold text-center text-[#e0e1dd] mb-6">{{ auth()->user()->email }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
File diff suppressed because one or more lines are too long
@ -5,3 +5,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('dashboard', function () {
|
||||||
|
return view('dashboard');
|
||||||
|
})->middleware('auth');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user