aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2022-05-06 13:42:26 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2022-05-06 13:42:26 -0400
commitef6e25936d7aaa6fd4650d9ed27bd8b1c6d5c21d (patch)
tree5abfcbab52a82ff275e352497230e94c2bf3f721
parent9917a9882eff675567007194661df57450016c89 (diff)
downloadlevitating-ef6e25936d7aaa6fd4650d9ed27bd8b1c6d5c21d.tar.gz
levitating-ef6e25936d7aaa6fd4650d9ed27bd8b1c6d5c21d.zip
Auth level for a request is now updated when a session token in gemini is found.
-rw-r--r--captain/response.f907
1 files changed, 5 insertions, 2 deletions
diff --git a/captain/response.f90 b/captain/response.f90
index 03d420e..02ed6dd 100644
--- a/captain/response.f90
+++ b/captain/response.f90
@@ -461,6 +461,7 @@ contains
end function request_has_query
subroutine request_set_token(self, token)
+ use captain_db
implicit none
class(request), intent(inout)::self
@@ -468,6 +469,7 @@ contains
allocate(character(len=len_trim(token)) :: self%token)
self%token = token
+ self%auth_level = get_session_auth_db(self%token)
end subroutine request_set_token
@@ -484,11 +486,12 @@ contains
if(safe_to_deallocate) then
deallocate(self%token)
end if
-
- self%token => null()
end if
+ self%token => null()
+ self%auth_level = 0
+
end subroutine request_clear_token
! This routine is needed if we're stripping session identifiers