Skip to content

Commit 7a2849e

Browse files
committed
Allow seed.sh to take JWT from environment
1 parent bafc919 commit 7a2849e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

node_mongo/seed.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ readonly API_ENDPOINT=:3000/api
44

55
# Forged admin credentials: { "admin": true }
66
# This value depends on JWT_SECRET for your environment.
7-
export JWT_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZX0.8KFeahppAFH8WUxwGLLkbBAaZHF5ZKciOG5HSQ0gajo
7+
# Pass it as an environment variable to this script.
8+
#
9+
# JWT_AUTH_TOKEN=abcd...6789 ./seed.sh
10+
#
11+
# The script will use the value from the environment, but
12+
# default to the value below if you don't pass one in.
13+
export JWT_AUTH_TOKEN=${JWT_AUTH_TOKEN:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZX0.8KFeahppAFH8WUxwGLLkbBAaZHF5ZKciOG5HSQ0gajo}
814

915
function addUser() {
1016
local name=$1; shift

0 commit comments

Comments
 (0)