From 9448dd73ce6d4f37670e8b66a9b898e8939fa745 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 3 Aug 2024 20:43:38 +0300 Subject: [PATCH] implement auth with existing identity --- src/Entity/Browser/Container/Page/Auth.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Entity/Browser/Container/Page/Auth.php b/src/Entity/Browser/Container/Page/Auth.php index cad964a9..2508e7d5 100644 --- a/src/Entity/Browser/Container/Page/Auth.php +++ b/src/Entity/Browser/Container/Page/Auth.php @@ -180,10 +180,19 @@ class Auth { if ($option->gtk->get_active()) { - // Auth + // Logout previous identities for this request + $this->page->container->browser->database->auth->logout( + $this->page->navbar->request->getValue() + ); + + // Activate existing identity if ($id) { - // @TODO activate existing record + // Add new auth record + $this->page->container->browser->database->auth->add( + $id, + $this->page->navbar->request->getValue() + ); } // Generate new identity @@ -202,11 +211,6 @@ class Auth // Init identity model $identity = new Gemini; - // Logout previous set - $this->page->container->browser->database->auth->logout( - $this->page->navbar->request->getValue() - ); - // Add new auth record $this->page->container->browser->database->auth->add( $this->page->container->browser->database->identity->add(