From d2221566cbb9457c3787688edf136e42ac647517 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Mar 2023 18:08:38 +0100 Subject: [PATCH] Now we serve cookie --- API/SALT.sh | 8 +++++--- templates/index.302 | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/API/SALT.sh b/API/SALT.sh index 44473f47..7a194373 100755 --- a/API/SALT.sh +++ b/API/SALT.sh @@ -452,10 +452,12 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh fi echo ${REP} - - REPLACE=${myASTROPORT}/ipns/$(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) - + ASTRONAUTENS=$(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) + REPLACE=${myASTROPORT}/ipns/${ASTRONAUTENS} + ## SET COOKIE sed "s~_TWLINK_~${REPLACE}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/coucou/${MOATS}.index.redirect + sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect + sed -i "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect echo "url='"${REPLACE}"'" >> ~/.zen/tmp/coucou/${MOATS}.index.redirect cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & diff --git a/templates/index.302 b/templates/index.302 index c0a08653..4bac1bb3 100644 --- a/templates/index.302 +++ b/templates/index.302 @@ -3,5 +3,6 @@ Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET Content-Type: text/html; charset=UTF-8 +Set-Cookie: sessionId= userId=_G1PUB_ ipnsId=_ASTRONAUTENS_ Location: _TWLINK_