You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This way signed global IDs can be compared even if generated in different places (we get this issue with html select elements, and with ids generated across the app).
Example code to add to ApplicationController:
before_action:set_sgid_expiry# Set a default expiry for SGIDs which means that any ids generated within this request will have the same value# and can thus be matched on the frontenddefset_sgid_expirySignedGlobalID.expires_at1.week.from_nowend
Would this be something viable?
The text was updated successfully, but these errors were encountered:
# app/controllers/application_controller.rbbefore_action:set_sgid_expiry# Set a default expiry for SGIDs which means that any ids generated within this request will have the same value# and can thus be matched on the frontenddefset_sgid_expiryCurrent.signed_global_id_expires_at=1.week.from_nowend
# config/initializers/monkey_patches.rb# Require all Ruby files in the core_extensions directoryDir[Rails.root.join('lib','patches','*.rb')].each{ |f| requiref}SignedGlobalID.prependPatches::SignedGlobalID
This way signed global IDs can be compared even if generated in different places (we get this issue with html select elements, and with ids generated across the app).
Example code to add to
ApplicationController
:Would this be something viable?
The text was updated successfully, but these errors were encountered: