File tree Expand file tree Collapse file tree
fake-snippets-api/routes/api/accounts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export default withRouteSpec({
1010 methods : [ "GET" , "POST" ] ,
1111 auth : "session" ,
1212 commonParams : z . object ( {
13+ tscircuit_handle : z . string ( ) . optional ( ) ,
1314 github_username : z . string ( ) . optional ( ) ,
1415 } ) ,
1516 jsonResponse : z . object ( {
@@ -19,8 +20,16 @@ export default withRouteSpec({
1920 } ) ,
2021} ) ( async ( req , ctx ) => {
2122 let account : Account | undefined
22- const { github_username } = req . commonParams
23- if ( github_username ) {
23+ const { github_username, tscircuit_handle } = req . commonParams
24+ if ( tscircuit_handle ) {
25+ const foundAccount = ctx . db . accounts . find (
26+ ( acc : Account ) =>
27+ acc . tscircuit_handle ?. toLowerCase ( ) === tscircuit_handle . toLowerCase ( ) ,
28+ )
29+ if ( foundAccount ) {
30+ account = { ...foundAccount , email : undefined }
31+ }
32+ } else if ( github_username ) {
2433 const foundAccount = ctx . db . accounts . find (
2534 ( acc : Account ) =>
2635 acc . github_username ?. toLowerCase ( ) === github_username . toLowerCase ( ) ,
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export default function UserSettingsPage() {
126126 const userInfo = [
127127 {
128128 label : "GitHub Username" ,
129- value : account ?. github_username || "Not available " ,
129+ value : account ?. github_username || "Not connected " ,
130130 } ,
131131 {
132132 label : "Email" ,
You can’t perform that action at this time.
0 commit comments