Skip to content

Conversation

@praptisharma28
Copy link
Contributor

@praptisharma28 praptisharma28 commented Dec 26, 2024

#604

Closes #604

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #604 .

Description of Changes

  • Added captive-portal-handler.js to handle authentication failure detection and error messaging.
  • When a captive portal authentication fails, it redirects back to the login page.

Also:

  • By changing to:

import LoginComponent from "../login";

  • We're getting the default export (the connected component) and there's no ambiguity about which version we're using as I was getting ESLint error

@praptisharma28 praptisharma28 changed the base branch from captiveportal to master December 26, 2024 11:35
@praptisharma28 praptisharma28 changed the title [tests] Added tests for captive-portal handler #604 [change] Allowed showing failure messages coming from captive portal #604 Dec 26, 2024
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the wait @praptisharma28, this has been buried under a pile of open PRs.

What steps can we do to manually test this?

Can you add at least one screenshot to the PR description or to a reply here please?

See my comment below.

import Loader from "../../utils/loader";
import needsVerify from "../../utils/needs-verify";
import Login from "../login";
import LoginComponent from "../login";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand where this LoginComponent is coming from. Is this some naming convention in react or what? I can't see the definition of this class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#838 (comment)

@nemesifier here I have mentioned that I was getting an ESlint error, but what error in particular, I don't remember as it's been long. Got a new laptop hence need to set it up again and check, will let you know today itself.

Copy link
Contributor Author

@praptisharma28 praptisharma28 Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hii @nemesifier , I am getting this ESlint error:
error Using exported name 'Login' as identifier for default export import/no-named-as-default
The error occurs on 2 files:
openwisp/openwisp-wifi-login-pages/client/components/organization-wrapper/organization-wrapper.js openwisp/openwisp-wifi-login-pages/client/components/organization-wrapper/organization-wrapper.test.js
and i guess, it is because this ESLint rule (import/no-named-as-default) is warning me about a potentially confusing pattern in imports.

Here's the screenshot:
Screenshot 2025-04-07 at 6 40 54 PM

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 this pull request may close these issues.

[change] Allow showing failure messages coming from captive portal

2 participants