如何在扑朔迷离的飞溅屏幕中与主屏幕进行比较

发布于 2025-02-13 22:24:05 字数 114 浏览 0 评论 0原文

假设,我在此应用程序上有两个用户(老师& student)。他们的平台或主屏幕不同,登录和注册部分也不同。现在,我希望登录状态(学生或老师)比较飞溅屏幕,以查看谁具有登录名并将其发送到主屏幕。怎么能这样做?

Suppose, I have two users on this App (Teacher & Student). Their platform or home screen is different and so is the login, and registration section. Now I want the login status (student or teacher) to compare the splash screen to see who has the login and send it to its home screen. How can do this?enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏至、离别 2025-02-20 22:24:05

您需要为每个用户分配角色,然后根据角色进行路由。
2您可以在其中存储角色信息的地方:

  • 在该用户的Firebase身份验证令牌中作为
  • 数据库中的自定义声明,如果您使用的是与该用户相关的文档,则在表中使用SQL。请创建一个不同的表来存储用户详细信息,并将用户ID用作外键。不要弄乱身份验证提供商生成的表。

始终从可信赖的环境中设置角色,否则您的用户将能够更改自己的角色。

完成此操作后,您可以从应用程序中访问角色信息并进行基于角色的授权(在您的情况下,路由)

You need to assign a role each user, and then do the routing based on the role.
2 places where you can store the role information:

  • In the Firebase Authentication token of that user as a custom claim
  • In the database, either as a document associated with that user or in a table if you're using SQL. Please create a different table to store user details and use the user id as a foreign key. Do not mess with the tables generated by the authentication provider.

Always set the role from a trusted environment, otherwise your users will be able to change their own roles.

Once this is done, you can access the role information from your app and do role based authorization (in your case, routing)

假情假意假温柔 2025-02-20 22:24:05

您可以进行基于角色的授权。这是一个示例

You can make role-based authorization. Here is an example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文