Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法登出不是自己的账户 #36

Closed
YDX-2147483647 opened this issue Apr 13, 2023 · 0 comments · Fixed by #37
Closed

无法登出不是自己的账户 #36

YDX-2147483647 opened this issue Apr 13, 2023 · 0 comments · Fixed by #37

Comments

@YDX-2147483647
Copy link
Contributor

YDX-2147483647 commented Apr 13, 2023

Note 这个需求不太正常,可以先忽略着……

问题

校园网已经登录了别人的账号,现在希望登出,然后切换成自己的。目前bitsrun做不到,但从 10.0.0.55 能做到。

bitsrun logout会初始化User,触发下面的错误。

bitsrun/bitsrun/user.py

Lines 56 to 61 in 49ec0f9

# Validate if current logged in user matches the provided username
if self.logged_in_user and self.logged_in_user != self.username:
raise Exception(
f"Current logged in user ({self.logged_in_user}) and "
f"yours ({self.username}) does not match"
)

场景

我(“我”)和其他同学(“其他设备”)共用同一个桥接的校园网(“桥接路由器”),轮流登录账号。

flowchart
    BIT-Web --- 一般设备
    BIT-Web --- 桥接路由器 --- 我
    桥接路由器 --- 其他设备
    
    subgraph login[登录校园网]
        桥接路由器
        一般设备
    end
Loading

可能的修复

(我能尝试自己解决,但要先讨论下)

  • 把 error 改成 warning。

    用什么警告呢?warnings 行吗?还是 click-log

  • 登出时按照self.logged_in_user,而不用self.username

    "username": self.username,

    (尚未实际验证)

@YDX-2147483647 YDX-2147483647 changed the title 无法退出不是自己的账户 无法登出不是自己的账户 Apr 13, 2023
YDX-2147483647 added a commit to YDX-2147483647/bitsrun that referenced this issue May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant