mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-20 11:22:25 +02:00
git-subtree-dir: foundations/hulypulse git-subtree-mainline:64e456e0ecgit-subtree-split:27e5a23ee9
17 lines
401 B
Bash
Executable File
17 lines
401 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CONFIG_PATH="../src/config/default.toml"
|
|
SECRET=$(grep '^token_secret' "$CONFIG_PATH" | sed -E 's/.*=\s*"(.*)"/\1/') # "
|
|
|
|
if [ -z "$SECRET" ]; then
|
|
echo "❌No token_secret in $CONFIG_PATH"
|
|
exit 1
|
|
fi
|
|
|
|
claims=$1 # "claims.json"
|
|
|
|
#TOKEN=$(echo -n "${SECRET}" | jwt -alg HS256 -key - -sign claims.json)
|
|
TOKEN=$(echo -n "${SECRET}" | jwt -alg HS256 -key - -sign ${claims})
|
|
|
|
echo "$TOKEN"
|