Skip to content

Commit

Permalink
Update with debugging code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ErinClaudio committed Jun 21, 2023
1 parent b3f22d1 commit b4e22a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def set_current_user
RequestStore.store[:current_user] = current_user
end

def set_timeout_duration
@timeout_duration = current_user.timeout_in
end
# def set_timeout_duration
# @timeout_duration = current_user.timeout_in
# end

def set_current_organization
RequestStore.store[:current_organization] = current_organization
Expand Down
3 changes: 3 additions & 0 deletions app/javascript/src/session_timeout_poller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

const deviseTimeoutInMinutes = 180
const timeoutDuration = 180;
// I could do this below if this is preferred
// const deviseTimeoutInMinutes = timeoutDuration || 180;
const twoMinuteWarning = deviseTimeoutInMinutes - 2
const totalTimerAmount = twoMinuteWarning * 60 * 1000
const deviseTimeoutInMilliseconds = deviseTimeoutInMinutes * 60 * 1000
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<%= og_tag :image, content: image_url('login.jpg') %>
<%= render 'shared/favicons' %>
<% binding.pry %>
<script>
var timeout = <%= @timeout_duration %>
</script>
Expand Down

0 comments on commit b4e22a1

Please sign in to comment.