@@ -25,8 +25,11 @@ function LoginForm() {
2525 } ) ;
2626 const [ error , setError ] = useState < string | null > ( null ) ;
2727 const [ loggedIn , setLoggedIn ] = useState ( false ) ;
28+ const [ logs , setLogs ] = useState < string [ ] > ( [ ] ) ;
2829 const [ linkStraboResponse , setLinkStraboResponse ] = useState < any > ( null ) ;
2930 const [ jParam , setJParam ] = useState < string | null > ( null ) ;
31+ const addLog = ( msg ) => setLogs ( ( prev ) => [ ...prev , msg ] ) ;
32+
3033 useEffect ( ( ) => {
3134 const params = new URLSearchParams ( window . location . search ) ;
3235 const j = params . get ( "j" ) ;
@@ -66,7 +69,7 @@ function LoginForm() {
6669 }
6770 ) ;
6871 const linkStraboBody = await linkStrabo . json ( ) ;
69- console . log ( "Link Strabospot!" , linkStraboBody ) ;
72+ addLog ( `Saving to Rockd database: ${ JSON . stringify ( linkStraboBody ) } ` ) ;
7073 setLinkStraboResponse ( linkStraboBody ) ;
7174 }
7275 setLoggedIn ( true ) ;
@@ -101,7 +104,9 @@ function LoginForm() {
101104 }
102105 ) ;
103106 const straboResponse = await rockdJWTToStrabo . json ( ) ;
104- console . log ( "Strabo Response:" , straboResponse ) ;
107+ addLog (
108+ `Rockd token sent to Strabospot: ${ JSON . stringify ( straboResponse ) } `
109+ ) ;
105110 } catch ( err ) {
106111 console . error ( "Failed to send Rockd JWT to Strabo:" , err ) ;
107112 }
@@ -112,11 +117,20 @@ function LoginForm() {
112117
113118 if ( loggedIn ) {
114119 return h ( "div" , { className : "login-page" } , [
120+ h ( "img" , {
121+ src : "https://storage.macrostrat.org/assets/rockd/main-page/rockd_transparent.png" ,
122+ alt : "Rockd logo" ,
123+ className : "rockd-logo" ,
124+ } ) ,
115125 h ( Callout , {
116126 title : "Login Successful" ,
117127 intent : Intent . SUCCESS ,
118128 className : "login-info" ,
119129 } ) ,
130+ h ( "div" , { className : "login-logs" } , [
131+ h ( "h4" , "Debug logs" ) ,
132+ h ( "pre" , logs . map ( ( l ) => `${ l } \n` ) . join ( "" ) ) ,
133+ ] ) ,
120134 h (
121135 Button ,
122136 { intent : Intent . DANGER , onClick : ( ) => setLoggedIn ( false ) } ,
@@ -125,6 +139,11 @@ function LoginForm() {
125139 ] ) ;
126140 } else {
127141 return h ( "div" , { className : "login-page" } , [
142+ h ( "img" , {
143+ src : "https://storage.macrostrat.org/assets/rockd/main-page/rockd_transparent.png" ,
144+ alt : "Rockd logo" ,
145+ className : "rockd-logo" ,
146+ } ) ,
128147 h ( "h2" , "Login" ) ,
129148 error &&
130149 h ( Callout , {
0 commit comments