简体   繁体   中英

Accepting user input during login

In my app the user may belong to multiple groups. But the requirement is such that I need to display records/options only for one group which the user will choose while logging in. Right now I am just getting the group id and setting it with setState in the authenticate() method of UserIdentity, which works fine if the user belongs to only a single group. However, if the user belongs to multiple groups I need to provide them with a choice to select which group he/she wants to be logged in to. How do I get that input from user right from UserIdentity/authenticate? Or if that is not possible what is the nearest solutions? Thanks.

  1. You authinticate user;

    1.1. User has only one group: setState('GroupId', $GroupId)

    1.2. User has many groups: you redirect him to special page , where he can choose his group.

    1.2.1. When user selected group, you setState('GroupId', $GroupId), and redirect back to site's page

  2. If User not have GroupId, you redirect him to special page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM