I think the general advice has become to separate “log in methods/credentials” from “user accounts”, because you can more easily manage user data and login data.
So you may end up with
user: id, name, email
web_login: user_id, hash, last_used, last_host, recovery_code
totp_login: user_id, secret, last_used, last_host
oauth_login: user_id, token, ...
...
etc. Instead of ending up with really fat user tables.
It maybe depends on your desired complexity, but you don’t really lose much by normalising the database.
If you do stick them all in the single table, I would recommend creating different schemas for each login method so your modules are better focused. (You can define multiple schemas that point to one table and have each only include the pertinent fields.)
You can ensure your data has integrity with database constraints (see ecto constraint validation).
E: Sorry I may have been a bit unclear to your actual question, you can put stripe_connect_id
in the users
table, it really depends on how much you think you will end up stuffing in there and how much you want to normalise your dataset.
I personally structure my accounts like this:
users: id, email, hashed_password
users_roles: user_id, role_id
roles: id, type
profiles: user_id, name, avatar, ...
If I wanted to store a users stripe data (unfamiliar with the specifics of the API) I personally would put it in another table:
user_stripes: user_id, connect_id, account_name?, public_key?, ...
This means you can more easily expand to have a user own multiple stripe accounts, etc.