-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[change] Allowed showing failure messages coming from captive portal #…
- Loading branch information
1 parent
47b500b
commit d1f2772
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function _getParam(name) { | ||
if (name = (new RegExp("[?&]" + encodeURIComponent(name) + "=([^&]*)")).exec(location.search)) | ||
return decodeURIComponent(name[1]); | ||
} | ||
export default function handleCaptivePortalLogin(captivePortalLoginForm, setCaptivePortalError) { | ||
const res = _getParam("res"); | ||
const reply = _getParam("reply"); | ||
if (res === "failed" && reply) { | ||
setCaptivePortalError({ | ||
type: "authError", | ||
message: reply, | ||
}); | ||
} else { | ||
setCaptivePortalError(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters