Open mohammadranjbarz opened 1 year ago
After talking with @MoeNick I suggest this draft and love to hear feedbacks from @aminlatifi and @CarlosQ96
Create this table | name | type | required | description |
---|---|---|---|---|
service | string | yes | email, linkedin, twitter, google | |
uniqueId | integer | yes | some permanent unique thing like id or email address | |
username | integer | no | unique but not permanent because users can change their usernames in twitter, linkedin, ... | |
createdAt | Date | yes | ||
userId | integer | yes | one to one relation | |
metadata | object | no | Depends on what data return by each service ( twitter and linkedin return different metadata) |
Create this table | name | type | required | description |
---|---|---|---|---|
address | string | yes | something like 0x2CF9444f69E4A394ecAc42bf2C6d7F91F646Ba0D | |
provider | string | yes | metamask, torus, ... | |
isMain | boolean | true | Each user can have only one main wallet address and unlimited non-main wallet addresses | |
createdAt | Date | yes | ||
userId | integer | yes | many to one relation | |
network | integer | yes | Wallet address signed with which network first time of login(1,5,100,...) |
Should implement a webservice for create user_connected_accounts
record and authentication microservice will call it, so if a user login with social accounts in authentication microservice that would call impact-graph and here we create a record for that if not exists
when authentication micro service wants to issue a token call this webservice and user's data then put more payload in JWT token ( for instance user login with email but microservice can get wallet address and userId and put them in JWT)
For users that want to verify their emails that are in their profile in imapct-graph db like what we have in adding email in verification form
User send the email's OTP and if it's correct we verify their email
This is a GET
API that users can call it and get an auth link based on their selected social network
For instance one for LinkedIn, and one for twitter, ...
Should call impact-graph get user info web service and put more data in JWT payload, then frontend can decide better to show what flow to user based on token's payload
I don't have idea about it yet, now we work with wallet address, but we should decide what we want to do, maybe we should work based on userId
so then doesn't matter user logged in with what wallet address we can show them all notifications, it's not clear for me yet, need to discuss with @MoeNick more about it
I agree with the data model, in the wallet_address I don't think the network is important if they can switch easily. (unless it's a network dependent wallet).
Add the updatedAt to all models.
The notification center is quite complex, because as we said, we work with the addresss because the authentication microservice works with the address. If we use the impactgraph userid, the notificationcenter will be coupled to the impactgraph. We should have a meeting to decide this. Especially because users with only social media login, cant use the notification center. And we would also need to group them in the notification center to know they are the same person.
We would need also to add a createAddress if not exist or is taken service. The scenario is: The person logs in with social media, and then proceeds to connect a new wallet that is not in it's list.
https://forum.giveth.io/t/multi-level-account-and-improving-the-user-flows-for-all-users/844