-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React project for client side authentication
- Loading branch information
Showing
45 changed files
with
17,438 additions
and
0 deletions.
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,3 @@ | ||
BROWSER=none | ||
SKIP_PREFLIGHT_CHECK=true | ||
|
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,4 @@ | ||
PORT=44445 | ||
HTTPS=true | ||
SKIP_PREFLIGHT_CHECK=true | ||
|
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,21 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Large diffs are not rendered by default.
Oops, something went wrong.
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,33 @@ | ||
// This script sets up HTTPS for the application using the ASP.NET Core HTTPS certificate | ||
const fs = require('fs'); | ||
const spawn = require('child_process').spawn; | ||
const path = require('path'); | ||
|
||
const baseFolder = | ||
process.env.APPDATA !== undefined && process.env.APPDATA !== '' | ||
? `${process.env.APPDATA}/ASP.NET/https` | ||
: `${process.env.HOME}/.aspnet/https`; | ||
|
||
const certificateArg = process.argv.map(arg => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0]; | ||
const certificateName = certificateArg ? certificateArg.groups.value : process.env.npm_package_name; | ||
|
||
if (!certificateName) { | ||
console.error('Invalid certificate name. Run this script in the context of an npm/yarn script or pass --name=<<app>> explicitly.') | ||
process.exit(-1); | ||
} | ||
|
||
const certFilePath = path.join(baseFolder, `${certificateName}.pem`); | ||
const keyFilePath = path.join(baseFolder, `${certificateName}.key`); | ||
|
||
if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) { | ||
spawn('dotnet', [ | ||
'dev-certs', | ||
'https', | ||
'--export-path', | ||
certFilePath, | ||
'--format', | ||
'Pem', | ||
'--no-password', | ||
], { stdio: 'inherit', }) | ||
.on('exit', (code) => process.exit(code)); | ||
} |
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,55 @@ | ||
// This script configures the .env.development.local file with additional environment variables to configure HTTPS using the ASP.NET Core | ||
// development certificate in the webpack development proxy. | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const baseFolder = | ||
process.env.APPDATA !== undefined && process.env.APPDATA !== '' | ||
? `${process.env.APPDATA}/ASP.NET/https` | ||
: `${process.env.HOME}/.aspnet/https`; | ||
|
||
const certificateArg = process.argv.map(arg => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0]; | ||
const certificateName = certificateArg ? certificateArg.groups.value : process.env.npm_package_name; | ||
|
||
if (!certificateName) { | ||
console.error('Invalid certificate name. Run this script in the context of an npm/yarn script or pass --name=<<app>> explicitly.') | ||
process.exit(-1); | ||
} | ||
|
||
const certFilePath = path.join(baseFolder, `${certificateName}.pem`); | ||
const keyFilePath = path.join(baseFolder, `${certificateName}.key`); | ||
|
||
if (!fs.existsSync('.env.development.local')) { | ||
fs.writeFileSync( | ||
'.env.development.local', | ||
`SSL_CRT_FILE=${certFilePath} | ||
SSL_KEY_FILE=${keyFilePath}` | ||
); | ||
} else { | ||
let lines = fs.readFileSync('.env.development.local') | ||
.toString() | ||
.split('\n'); | ||
|
||
let hasCert, hasCertKey = false; | ||
for (const line of lines) { | ||
if (/SSL_CRT_FILE=.*/i.test(line)) { | ||
hasCert = true; | ||
} | ||
if (/SSL_KEY_FILE=.*/i.test(line)) { | ||
hasCertKey = true; | ||
} | ||
} | ||
if (!hasCert) { | ||
fs.appendFileSync( | ||
'.env.development.local', | ||
`\nSSL_CRT_FILE=${certFilePath}` | ||
); | ||
} | ||
if (!hasCertKey) { | ||
fs.appendFileSync( | ||
'.env.development.local', | ||
`\nSSL_KEY_FILE=${keyFilePath}` | ||
); | ||
} | ||
} |
Oops, something went wrong.