From f85af642d2bd37c4e671d8d2b1bbd276cdd644f0 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 27 Aug 2024 14:45:21 -0400 Subject: [PATCH] API Service para manejo de token --- app/src/Service/API.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/src/Service/API.php diff --git a/app/src/Service/API.php b/app/src/Service/API.php new file mode 100644 index 0000000..7a30d77 --- /dev/null +++ b/app/src/Service/API.php @@ -0,0 +1,23 @@ +getHeader('Authorization'); + foreach ($auth_headers as $header) { + if (str_contains($header, 'Bearer')) { + return substr($header, strlen('Bearer ')); + } + } + throw new MissingAuthorizationHeader(); + } +}