mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
client/web: only trigger check mode if not authed
After logging in, the `?check=now` query string is still present if it was passed. Reloading the page causes a new check mode to be triggered, even though the user has an active session. Only trigger the automatic check mode if the user is not already able to manage the device. Updates tailscale/corp#14335 Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
parent
79719f05a9
commit
74947ce459
@ -41,6 +41,7 @@ export default function useAuth() {
|
||||
default:
|
||||
setLoading(false)
|
||||
}
|
||||
return d
|
||||
})
|
||||
.catch((error) => {
|
||||
setLoading(false)
|
||||
@ -64,10 +65,14 @@ export default function useAuth() {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
loadAuth()
|
||||
if (new URLSearchParams(window.location.search).get("check") == "now") {
|
||||
newSession()
|
||||
}
|
||||
loadAuth().then((d) => {
|
||||
if (
|
||||
!d.canManageNode &&
|
||||
new URLSearchParams(window.location.search).get("check") == "now"
|
||||
) {
|
||||
newSession()
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user