ruby on rails - Devise authentication for polymorphic solution -


consider application, needs have 2 different types of user:

  • user in standard client
  • organization entity offering services through application

requirements:

  • different standard controllers (sessions, registrations etc)
  • access different parts of application of course

this seems walk in park creating 2 separate models devise, wouldn't duplicate functionality authentication.

i went polymorphic association, organization , user different models, both 1-1 relation entity representing authentication. entity has devise attributes (like password etc), while others have type-specific ones. unfortunately solution comes lot of drawbacks, having define custom helpers, warden strategies , devise failure apps.

i'm wondering, there concise solution type of issue?

ideally, having 2 devise models delegating regarding authentication separate entity.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -