Sha256: 3134ed8b0c596baa93110b5c3eee0ec611e94b81fbcc78b54e31f6eab7012711
Contents?: true
Size: 971 Bytes
Versions: 18
Compression:
Stored size: 971 Bytes
Contents
= Share configuration via inheritance If you have multiple configurations that needs to share some amount of authentication behaviour, you can do so through inheritance. For example: require "rodauth" class RodauthBase < Rodauth::Auth configure do # common authentication configuration end end class RodauthMain < RodauthBase # inherit common configuration configure do # main-specific authentication configuration end end class RodauthAdmin < RodauthBase # inherit common configuration configure do # admin-specific authentication configuration end end class RodauthApp < Roda plugin :rodauth, auth_class: RodauthMain plugin :rodauth, auth_class: RodauthAdmin, name: :admin # ... end However, when doing this, you need to be careful that you do not use a configuration method in a superclass, and then load a feature in a subclass that overrides the configuration you set in the superclass.
Version data entries
18 entries across 18 versions & 1 rubygems