File tree Expand file tree Collapse file tree 2 files changed +47
-3
lines changed Expand file tree Collapse file tree 2 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 5151 - checkout
5252 - run : apt-get install lsof
5353 - run : git config --global url."https://github.com/".insteadOf ssh://git@github.com/
54- - run : curl -fsSL https://deb.nodesource.com/setup_16.x | bash
55- - run : apt install -y nodejs
56- - run : node --version
54+ - run : curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
55+ - run : |
56+ set +e
57+ export NVM_DIR="$HOME/.nvm"
58+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
59+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
60+ nvm install 16
61+
62+ echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
63+ echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
5764 - run : echo "127.0.0.1 localhost.org" >> /etc/hosts
5865 - run : go version
5966 - run : rm -rf /etc/alternatives/java
Original file line number Diff line number Diff line change @@ -675,6 +675,43 @@ func callSTInit(passwordlessConfig *plessmodels.TypeInput) {
675675 rw .WriteHeader (200 )
676676 rw .Write ([]byte ("{\" status\" : \" OK\" }" ))
677677 }).ServeHTTP (rw , r )
678+ } else if r .URL .Path == "/deleteUser" {
679+ bodyBytes , err := ioutil .ReadAll (r .Body )
680+ if err != nil {
681+ rw .WriteHeader (500 )
682+ rw .Write ([]byte ("Internal error" ))
683+ return
684+ }
685+ var body map [string ]interface {}
686+ err = json .Unmarshal (bodyBytes , & body )
687+ if err != nil {
688+ rw .WriteHeader (500 )
689+ rw .Write ([]byte ("Internal error" ))
690+ return
691+ }
692+
693+ if body ["rid" ] != "emailpassword" {
694+ rw .WriteHeader (400 )
695+ rw .Write ([]byte ("{\" message\" : \" Not Implemented\" }" ))
696+ return
697+ }
698+
699+ user , err := emailpassword .GetUserByEmail (body ["email" ].(string ))
700+ if err != nil {
701+ rw .WriteHeader (500 )
702+ rw .Write ([]byte ("Internal error" ))
703+ return
704+ }
705+
706+ err = supertokens .DeleteUser (user .ID )
707+ if err != nil {
708+ rw .WriteHeader (500 )
709+ rw .Write ([]byte ("Internal error" ))
710+ return
711+ }
712+
713+ rw .WriteHeader (200 )
714+ rw .Write ([]byte ("{\" status\" : \" OK\" }" ))
678715 }
679716 }))
680717
You can’t perform that action at this time.
0 commit comments