Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Change sur les Cookies connect. (#7)
Browse files Browse the repository at this point in the history
* essais validator

* test de bdd

* valdation and console back

* bdd gestion

* discord init

* Discord and change route ATC

* add bootstrap

* register

* discord and page training

* validation donées form

* users database

* test de database

* session serveur

* whiteList creat

* whitelist controller and database

* testing

* gestion des logs

* des test

* Modification Auth

* slug

* modification visuelle

* mise en place admins systeme

* page modo and admin users

* api sanct

* mods API

* Request APi keys page

* api keys suite

* test

* test2

* test3

Signed-off-by: Alexandre Caussades <alexaussades@gmail.com>

* test4

* test5

* test7

* test8

* update API Serveur

* connect API token

* view logs

* database and set cookie

* Connect users and modfy users serveur

---------

Signed-off-by: Alexandre Caussades <alexaussades@gmail.com>
Co-authored-by: Alexandre Caussades <alexaussades@gmail.com>
  • Loading branch information
alexcaussades and Alexandre Caussades authored Jun 3, 2023
1 parent 95434e0 commit 13989f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/usersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public function autentification(loginValidatorRequest $request)
$request->session()->regenerate();
$user = users::where("id", auth()->user()->id)->first();
Cookie::queue('email-Users', $user->email, time() + 60 * 60 * 24 * 30);
Cookie::queue('remember_token', $user->remember_token, time() + 60 * 60 * 24 * 30);
if ($request->remember == "on"){
Cookie::queue('remember_token', $user->remember_token, time() + 86400 * 30);
}
//** Check if user is admin */
$admin = new Admin();
$check = $admin::where('email', $credentials['email'])->first();
Expand Down Expand Up @@ -95,7 +97,7 @@ public function autentification(loginValidatorRequest $request)
Auth::guard('admin')->attempt(['email' => Cookie::get('email-Users')]);
}
$modo = new modo();
$check = $modo::where('email', $credentials['email'])->first();
$check = $modo::where('email', Cookie::get('email-Users'))->first();
if ($check) {
Auth::guard('modo')->attempt(['email' => Cookie::get('email-Users')]);
}
Expand Down
Binary file modified database/database.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/views/serveur/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</style>

<div class="container">
<h1> Bienvenue </h1>
<h1> Bienvenue {{ auth()->user()->name }}</h1>

@auth('admin')
<div class="alert alert-info" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

Route::get('/', function (Request $request) {
/** creation d'un cookie sur laravel */
dd(Cookie::get("name"));
dd(Cookie::get('email-Users'), Cookie::get('remember_token'));
return response()->view('welcome')->cookie('name', 'value', 0.5);
})->where('client', '[0-9]+');

Expand Down

0 comments on commit 13989f8

Please sign in to comment.