admin管理员组文章数量:1277267
Is there a way to associate multiple email addresses (2) with the same user account?
The goal is for the user to be able to use their company email or personal email to log into a company portal - into the same account.
The quickest solution I thought of was to create 2 separate accounts, use meta fields to create a relationship between them. Then, if someone logs in with a personal account, programatically log them into their primary (company) account. However, this might quickly become unmaintainable with account/password management, etc.
How would you go about implementing this?
Is there a way to associate multiple email addresses (2) with the same user account?
The goal is for the user to be able to use their company email or personal email to log into a company portal - into the same account.
The quickest solution I thought of was to create 2 separate accounts, use meta fields to create a relationship between them. Then, if someone logs in with a personal account, programatically log them into their primary (company) account. However, this might quickly become unmaintainable with account/password management, etc.
How would you go about implementing this?
Share Improve this question asked Nov 29, 2021 at 16:50 lastnooblastnoob 1632 silver badges10 bronze badges 1- not using WP out of the box, but single sign on plugins might allow for this. Eitherway a user will always have an email in the email column of the user table that is considered primary, no matter what you implement, and the functions/APIs are all built on the assumption of a single email, so if you do achieve this, be mindful of that – Tom J Nowell ♦ Commented Nov 29, 2021 at 18:33
1 Answer
Reset to default 1If you create them programmatically, you could set it up so that all of the usernames are one type of email address (business or personal) and the WP email address field contains the other type.
It's not clear if this would fit your particular use case, but one other login possibility is to integrate single sign-on. That way they could log in with their existing credentials - whether that's something like a work MS Exchange email, or a personal Gmail account, or some other type of account that all your users have in common.
本文标签:
版权声明:本文标题:plugin development - Associate multiple email addresses with the same user account, so they can log in with either 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741202109a2357433.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论