aboutsummaryrefslogtreecommitdiff
path: root/captain/response.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/response.f90')
-rw-r--r--captain/response.f9012
1 files changed, 12 insertions, 0 deletions
diff --git a/captain/response.f90 b/captain/response.f90
index 34c537c..e172cc1 100644
--- a/captain/response.f90
+++ b/captain/response.f90
@@ -73,6 +73,8 @@ implicit none
character(len=:), pointer::token => null()
character(len=4)::method = "GET"
+ integer::auth_level
+
type(query)::q
type(cookies)::c
@@ -111,6 +113,8 @@ contains
subroutine request_init(self, str, server_explicit, protocol_explicit, method, cookiestring)
use logging
use utilities, only: toupper
+ use captain_db, only: get_session_auth_db
+ use auth_levels, only: AUTH_NONE
implicit none
class(request) :: self
@@ -222,6 +226,14 @@ contains
if(.not.associated(self%token) .and. associated(self%c%get_value("token"))) then
self%token => self%c%get_value("token")
end if
+ else
+ call self%c%init()
+ end if
+
+ if(associated(self%token)) then
+ self%auth_level = get_session_auth_db(self%token)
+ else
+ self%auth_level = AUTH_NONE
end if
end subroutine request_init