Closed michaeljones closed 4 years ago
Thanks for raising the issue. I will look into it and get back to you soon.
Added an Authenticate.Remember
module (instead of Remember.Base
), so that the Remember
module can be more easily customized.
This is in version 2.4.
Problem
I have used Phauxth but opted to split the user information in an account table (email & password) and a user table (display name & other details). I realise that this is a non-standard use case and therefore you shouldn't necessarily have to adjust to this.
It mostly worked well but I have found myself returning
{user, account}
from theget_by
methods inaccounts.ex
. Unfortunately this errors when it hits thereport
helper inPhauxth.Authenticate.Base
as used byPhauxth.Remember
.This is manageable for the
report
functions inLogin
,Confirm
andAuthenticate
as I can create my own versions of those modules whichuse
theBase
implementations and then override thereport
functions but there isn't aPhauxth.Remember.Base
module to do that with.Solution
Move the contents of
Phauxth.Remember
intoPhauxth.Remember.Base
and havePhauxth.Remember
use
theBase
version so that it is easier to create a customRemember
module that usesPhauxth.Remember.Base
and overrides functions as needed.Additional info
I am quite new to Elixir and Phoenix so I might be doing or saying a lot of things wrong. I apologise if I am wasting your time with this.
I've opted to split the tables into accounts & users because that seems to be a good approach for handling multiple different authentication methods for a user. I don't have anything other than email & password at the moment but I like the idea of being a bit more future proof. It is possible that if I'm serious about using multiple auth methods that I should choose a different auth library. I can understand that.