Incorporating Devise Authentication into an already existing user structure?

后端 未结 3 1340
南方客
南方客 2021-02-06 08:38

I have a fully functional authentication system with a user table that has over fifty columns. It\'s simple but it does hash encryption with salt, uses email instead of usernam

3条回答
  •  旧巷少年郎
    2021-02-06 08:52

    I switched over an app from authLogic (I think) to Devise last year and my lessons were: - User table can stay - Rename columns to Devise standards, I'm sure this shouldn't be necessary, but unlike other authentication methodss, I didn't find a lib mapping file where I could add different db field names in as I have done with other authentication methods.

    That was actually about it. I was really suprised about how little I needed to do. I think my hashes actually still worked or I changed to routine as directed in the instruction.

    I use the 'admin' flag route with Devise so doing a sql conversion from whatever is used currently can do that.

    I would also get rid of the default "" bit, I have a production app (not sure what authentication it uses, some base64 thing I think) and that looks like: t.string "EMAIL", :limit => 64, :null => false t.string "PASSWORD", :limit => 64, :null => false

提交回复
热议问题