Skip to content

Commit

Permalink
still trying login issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Apr 11, 2024
1 parent 4b13647 commit 6d61c2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app/Http/Controllers/Auth/FireflyAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use App\Models\User;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

trait FireflyAuth
{
Expand All @@ -22,7 +24,7 @@ private function getIdentifierItems(string $identifier): array
];
}

public function logout(Request $request)
public function logout(Request $request): RedirectResponse
{
auth()->logout();

Expand All @@ -41,9 +43,8 @@ private function convertXmlToObject(string $xmlString): object
*/
$xml = simplexml_load_string($xmlString);
$json = json_encode($xml);
$obj = json_decode($json);

return $obj;
return json_decode($json);
}

private function findOrCreateUserAndLogin(string $xmlString): void
Expand All @@ -60,7 +61,8 @@ private function findOrCreateUserAndLogin(string $xmlString): void
}

// log them in
auth()->login($existingUser, true);
session()->flush();
Auth::login($existingUser, true);
// Update db with login time
auth()->user()->update(['updated_at' => now()]);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function callbackSuccess(Request $request, string $school): RedirectRespo

$this->findOrCreateUserAndLogin($output);

return redirect()->to(route('raiseaconcern.submit'));
return redirect('/submit');
}

$debugarray = [
Expand Down

0 comments on commit 6d61c2f

Please sign in to comment.