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

Feat/middleware #36

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Feat/middleware #36

wants to merge 5 commits into from

Conversation

BJvdA
Copy link
Member

@BJvdA BJvdA commented Dec 9, 2021

Implement the password checking using Next middleware.
Also exports the password checking logic in a separate class PasswordChecker, so it can be used on its own.
Closes #25

@vercel
Copy link

vercel bot commented Dec 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/storyofams/next-password-protect/5DZY4ph3wXxeso5LRC933GKam9Vp
✅ Preview: Failed

[Deployment for bdbfe9e failed]

@codecov
Copy link

codecov bot commented Dec 9, 2021

Codecov Report

Merging #36 (bdbfe9e) into master (ae94db6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #36   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7        11    +4     
  Lines          123       172   +49     
  Branches        47        68   +21     
=========================================
+ Hits           123       172   +49     
Impacted Files Coverage Δ
src/hoc/withPasswordProtect.tsx 100.00% <ø> (ø)
src/api/PasswordChecker.ts 100.00% <100.00%> (ø)
src/api/passwordCheckHandler.ts 100.00% <100.00%> (ø)
src/components/Login.tsx 100.00% <100.00%> (ø)
src/constants.ts 100.00% <100.00%> (ø)
src/middleware/html.ts 100.00% <100.00%> (ø)
src/middleware/middleware.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae94db6...bdbfe9e. Read the comment docs.

@bravo-kernel
Copy link

Looks good, why no merge?

Comment on lines +31 to +33
// jest
// .spyOn(api, 'PasswordChecker')
// .mockImplementationOnce(() => ({ check } as any));

Choose a reason for hiding this comment

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

Commented code should not be pushed to Github.

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.

Is there any easy way to protect a api route with this plugin?
3 participants