Skip to content

Why do I have to call authenticates_with_sorcery!? #562

Open
@arnvald

Description

@arnvald

Recently I've started wondering why I need to set the relation between the Sorcery and User class twice. First time, when I set user_class attribute in initializer, and second time, when I call authenticates_with_sorcery! in model.

Although potential issues are rare, rather easy to detect and fix, this just does not feel right to me and I think we should improve the design here.

I think we should do following:

  1. Deprecate and later remove user_class setting from initializer
  2. authenticates_with_sorcery! should set the class it's called in as a user_class variable for config (we could rename it to model_class to avoid confusion or something)
  3. Config class should raise an error if authenticates_with_sorcery! is called twice (for users who try to have separate user classes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions