Skip to content

Commit

Permalink
Merge pull request instantcommerce#63 from instantcommerce/feat/rebra…
Browse files Browse the repository at this point in the history
…nding

feat: rebranding
  • Loading branch information
BJvdA authored Sep 7, 2022
2 parents bd925f6 + aa9c743 commit 95f6e1a
Show file tree
Hide file tree
Showing 16 changed files with 1,676 additions and 2,713 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
- name: Install dependencies
run: yarn
- name: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Story of AMS
Copyright (c) 2021 Instant Commerce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<p align="center">
<a aria-label="Story of AMS logo" href="https://storyofams.com/" target="_blank" align="center">
<img src="https://avatars.githubusercontent.com/u/19343504" alt="Story of AMS" width="100">
<a aria-label="Instant Commerce logo" href="https://instantcommerce.io/" target="_blank" align="center">
<img src="https://avatars.githubusercontent.com/u/93975473" alt="Instant Commerce" width="100">
</a>
<h1 align="center">@storyofams/next-password-protect</h1>
<h1 align="center">next-password-protect</h1>
<p align="center">
<a aria-label="releases" href="https://GitHub.com/storyofams/next-password-protect/releases/" target="_blank">
<img src="https://github.com/storyofams/next-password-protect/workflows/Release/badge.svg">
<a aria-label="releases" href="https://github.com/instantcommerce/next-password-protect/releases/" target="_blank">
<img src="https://github.com/instantcommerce/next-password-protect/workflows/Release/badge.svg">
</a>
<a aria-label="npm" href="https://www.npmjs.com/package/@storyofams/next-password-protect" target="_blank">
<img src="https://img.shields.io/npm/v/@storyofams/next-password-protect">
<a aria-label="npm" href="https://www.npmjs.com/package/next-password-protect" target="_blank">
<img src="https://img.shields.io/npm/v/next-password-protect">
</a>
<a aria-label="codecov" href="https://codecov.io/gh/storyofams/next-password-protect" target="_blank">
<img src="https://codecov.io/gh/storyofams/next-password-protect/branch/master/graph/badge.svg?token=ZV0YT4HU5H">
<a aria-label="codecov" href="https://codecov.io/gh/instantcommerce/next-password-protect" target="_blank">
<img src="https://codecov.io/gh/instantcommerce/next-password-protect/branch/master/graph/badge.svg?token=ZV0YT4HU5H">
</a>
<a aria-label="stars" href="https://github.com/storyofams/next-password-protect/stargazers/" target="_blank">
<img src="https://img.shields.io/github/stars/storyofams/next-password-protect.svg?style=social&label=Star&maxAge=86400" />
<a aria-label="stars" href="https://github.com/instantcommerce/next-password-protect/stargazers/" target="_blank">
<img src="https://img.shields.io/github/stars/instantcommerce/next-password-protect.svg?style=social&label=Star&maxAge=86400" />
</a>
</p>
<p align="center">Password protect your Next.js deployments. <a href="http://next-password-protect.vercel.app/" target="_blank">View demo</a> (Password is <b>secret</b>)</p>
Expand All @@ -39,9 +39,9 @@ This library adds a password prompt to your Next.js deployment. It consists of t
## Installation

```sh
yarn add @storyofams/next-password-protect
yarn add next-password-protect
# or
npm install @storyofams/next-password-protect
npm install next-password-protect
```

## Usage
Expand All @@ -66,7 +66,7 @@ module.exports = {
Add two api routes, one with the `loginHandler` and one with the `passwordCheckHandler` api function. You can name them anything, as long as you pass the names to `loginApiUrl` and `checkApiUrl` respectively, in the next step. By default it expects `/login` and `/passwordCheck`.

```javascript
import { loginHandler } from "@storyofams/next-password-protect";
import { loginHandler } from "next-password-protect";

export default loginHandler("YOUR_SECRET_PASSWORD", {
// Options go here (optional)
Expand All @@ -75,7 +75,7 @@ export default loginHandler("YOUR_SECRET_PASSWORD", {
```

```javascript
import { passwordCheckHandler } from "@storyofams/next-password-protect";
import { passwordCheckHandler } from "next-password-protect";

export default passwordCheckHandler("YOUR_SECRET_PASSWORD", {
// Options go here (optional)
Expand All @@ -88,7 +88,7 @@ export default passwordCheckHandler("YOUR_SECRET_PASSWORD", {
Add the `withPasswordProtect` HOC to the default export of `App` in `pages/_app.tsx`:

```javascript
import { withPasswordProtect } from "@storyofams/next-password-protect";
import { withPasswordProtect } from "next-password-protect";

// Before: export default App;
export default process.env.PASSWORD_PROTECT
Expand Down
6 changes: 3 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<a href="https://storyofams.com/" target="_blank" align="center">
<img src="https://storyofams.com/public/[email protected]" alt="Story of AMS" width="120">
<a href="https://instantcommerce.io/" target="_blank" align="center">
<img src="https://avatars.githubusercontent.com/u/93975473" alt="Instant Commerce" width="120">
</a>
<h1 align="center">@storyofams/next-password-protect example</h1>
<h1 align="center">next-password-protect example</h1>
</p>

## Setup
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@reach/alert": "^0.7.4",
"@storyofams/react-helpers": "0.3.6",
"@storyofams/next-password-protect": "link:..",
"next-password-protect": "link:..",
"@styled-system/css": "^5.1.4",
"@styled-system/props": "^5.1.4",
"@svgr/webpack": "^5.0.1",
Expand Down Expand Up @@ -106,4 +106,4 @@
"git add"
]
}
}
}
4 changes: 2 additions & 2 deletions example/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class MyApp extends App {
export default process.env.PASSWORD_PROTECT
? withPasswordProtect(MyApp, {
loginComponentProps: {
backUrl: 'https://github.com/storyofams/next-password-protect',
logo: 'https://storyofams.com/public/[email protected]',
backUrl: 'https://github.com/instantcommerce/next-password-protect',
logo: 'https://avatars.githubusercontent.com/u/93975473',
},
})
: App;
2 changes: 1 addition & 1 deletion example/src/pages/api/login.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loginHandler } from '@storyofams/next-password-protect';
import { loginHandler } from 'next-password-protect';

export default loginHandler(process.env.STAGING_PASSWORD, {
cookieName: 'authorization',
Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/api/logout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logoutHandler } from '@storyofams/next-password-protect';
import { logoutHandler } from 'next-password-protect';

export default logoutHandler({
cookieName: 'authorization',
Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/api/passwordCheck.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { passwordCheckHandler } from '@storyofams/next-password-protect';
import { passwordCheckHandler } from 'next-password-protect';

export default passwordCheckHandler(process.env.STAGING_PASSWORD, {
cookieName: 'authorization',
Expand Down
Loading

0 comments on commit 95f6e1a

Please sign in to comment.