Made login

This commit is contained in:
neerholt
2021-03-04 13:13:07 +01:00
parent c3479e8e7b
commit 9a38284c8b
6 changed files with 61 additions and 8 deletions
+26
View File
@@ -1 +1,27 @@
<?php
require "../bootstrap.php";
use Backend\Models\Group;
use Backend\Models\Password;
//Start the php session
session_start();
if(isset($_POST['login'])){
$groupName = $_POST["groupName"];
$password = $_POST["password"];
$group = Group::where('groupName', $groupName )->first();
if($group){
$hashedPassword = $group->password()->id;
if(password_verify($password, $hashedPassword )){
$_SESSION['groupName'] = $groupName;
$_SESSION['success'] = "You are now logged in";
header('location: Main.php?yeah=aa');
}
}
}