Sha256: 9909ec45a2db2fc4300871db771632ff626bdd62d49f63ab9d70691f5540a2dd

Contents?: true

Size: 688 Bytes

Versions: 74

Compression:

Stored size: 688 Bytes

Contents

import { Controller } from '@hotwired/stimulus'

export default class extends Controller {
  static targets = ['element']

  static values = {
    confirm: String,
  }

  /**
  We are intercepting the sign-out submission to clear the cache first.
  By clearing the Turbo cache we are ensuring that when someone presses the back button
  after a sign-out attempt, the cache is not there in the browser and they can't
  navigate back to see sensitive information from the previous page.
  */
  handle(e) {
    e.preventDefault()

    // eslint-disable-next-line no-alert
    if (window.confirm(this.confirmValue)) {
      window.Turbo.cache.clear()

      this.element.submit()
    }
  }
}

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
avo-3.13.6 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.5 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.4 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.3 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.2 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.1 app/javascript/js/controllers/sign_out_controller.js
avo-3.13.0 app/javascript/js/controllers/sign_out_controller.js
avo-3.12.0 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.10 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.9 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.8 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.7 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.6 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.5 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.4 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.3 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.2 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.1 app/javascript/js/controllers/sign_out_controller.js
avo-3.11.0 app/javascript/js/controllers/sign_out_controller.js
avo-3.10.10 app/javascript/js/controllers/sign_out_controller.js