summaryrefslogtreecommitdiff
path: root/src/Types/LoginFlow.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-08-13 21:50:27 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-08-13 21:50:27 +0200
commit3f4b51b99a4f4dc41dbdce7f34afe7e15d3d426e (patch)
treeeed0848f59e70aac075ba09bbb1b6e52a62a681f /src/Types/LoginFlow.php
parentbeb68ad3ddc48f9e913815e0e18f11965201f32e (diff)
get login types route and various
Diffstat (limited to 'src/Types/LoginFlow.php')
-rw-r--r--src/Types/LoginFlow.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Types/LoginFlow.php b/src/Types/LoginFlow.php
new file mode 100644
index 0000000..bd948a8
--- /dev/null
+++ b/src/Types/LoginFlow.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Types;
+
+use App\Support\ArrayTransformable;
+
+class LoginFlow implements ArrayTransformable
+{
+ public function __construct(
+ private LoginType $type,
+ private bool $get_login_token = false,
+ )
+ {}
+
+ public function toArray(): array
+ {
+ $flow = [
+ "type" => $this->type,
+ ];
+
+ if ($this->type == LoginType::TOKEN) {
+ $flow["get_login_token"] = $this->get_login_token;
+ }
+
+ return $flow;
+ }
+}