简体   繁体   中英

Rails4, How to config multiple model on sorcery Gem

I change User model to normal_user and admin_user

And I wanna authenticate both user on web

My plan is

below sorcery config file is support only one Model.

config.user_class = "User"

But I wanna suport User and AdminUser.

How to config file or another solution setting multiple authencatin user?

You can try in Application controller (Module: Admin )

Rails.application.config.sorcery.user_class = Admin

or without module inside default application controller

Rails.application.config.sorcery.user_class = User

Perhaps it will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM