Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    rajbot
    @rajbot
    :wave:
    Charles Horn
    @hornc
    Hi @rajbot !
    rajbot
    @rajbot

    Richard suggested I look at adding a login form, so we can query a user's bookmarks. One issue is if we are testing the react app on localhost:3000, then how can we handle openlibrary.org cookies?

    This was an issue back in the day, so we set up localhost.archive.org and localhost.openlibrary.org, to point to 127.0.0.1

    So, you can test the react app on localhost.openlibrary.org:3000, and your OL cookies should Just Work...

    I'm gonna try to hack in a login form

    I'm glad this still works:
    $ nslookup localhost.openlibrary.org
    Server:        8.8.8.8
    Address:    8.8.8.8#53
    
    Non-authoritative answer:
    Name:    localhost.openlibrary.org
    Address: 127.0.0.1
    Mek
    @mekarpeles
    @rajbot currently one's lists are public, no?
    @hornc -- @rajbot is OG (original ganster!), he created our OPDS feed and has shown openlibary so much love
    Charles Horn
    @hornc
    @mekarpeles lists are public, just checked a random user's lists in an incognito window
    Mek
    @mekarpeles
    yup ^.^
    @rajbot In python, you can handle the cookie management using the openlibrary-client tool which @hornc has been championing!
    I suppose you could maintain this in localStorage as well [...]
    rajbot
    @rajbot
    cool.. @rchrd2_twitter: do we still need the OL-lite react app to log in, if lists are public?
    Mek
    @mekarpeles
    @rajbot only if we want users to be able to add to their lists
    Charles Horn
    @hornc
    I have openlibrary-lite ui-shell running locally, the readme instructions are good ;)
    Mek
    @mekarpeles
    Awesome
    Charles Horn
    @hornc
    @rajbot to view current books on loan and waitlist items we'll need login
    rajbot
    @rajbot
    I'm gonna make the ui-shell log into OL unless anyone tells me otherwise. Also, this is only possible because OL cookies are insecure...
    Mek
    @mekarpeles
    I'm split between trying to (a) attack #602 -- creating a mobile Open Library /browse UI, to render IA search results on OL or (b) creating a dashboard "Bookdrive" which empowers the community to fund digitization of books they want
    :sweat_smile: @ OL cookie security
    rajbot
    @rajbot
    Can anyone type anything in the Form page of the ui-shell?
    The text fields do not appear to take input..
    Charles Horn
    @hornc
    Text fields aren't taking input for me, but I can change gender, enter dates, and flick the switch
    rajbot
    @rajbot
    looks like they need onChange handlers
    warning.js:33 Warning: Failed form propType: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`. Check the render method of `SelectableInput`.
    Charles Horn
    @hornc
    yeah, errors on the form page: Warning: Unknown DOM property tabindex. Did you mean tabIndex? and the one above
    Richard Caceres
    @rchrd2_twitter

    Hi. The ui-shell is just a starter kit. I don't think the form is bound to anything. I think there's a way to make a react form un-managed.

    But that said, if you point me to the apis to call, I can wire it up.

    rajbot
    @rajbot
    yay i got it to work..
    Richard Caceres
    @rchrd2_twitter
    nice! i am going to push an update to that branch soon. I have the browse page pulling live content
    rajbot
    @rajbot
    sweet! I will work on my branch, but gotta first go get a snack for the kid :)
    rajbot
    @rajbot
    How should we make XHR requests from the react app?
    Richard Caceres
    @rchrd2_twitter
    pull the latest branch. i'm using jquery
    sorry for late reply. for some reason i'm not getting notifications
    Micah Carroll
    @micahcarroll
    @micahcarroll
    rajbot
    @rajbot
    So, for hacking up a login page, I am looking for a HTTP 303 response on successful login via POST to openlibrary.org/account/login, and HTTP 200 on failure? sorry
    rajbot
    @rajbot
    oh wow, you already added a login screen!
    Richard Caceres
    @rchrd2_twitter
    it was part of the demo app i started with :)
    Charles Horn
    @hornc
    @mekarpeles I just re-fixed a bug with the dev instance that was raised from the solr discussions with dvd this morning... unfortunately cdrini had already fixed it with a workaround (my fault for not checking!)... PR here for discussion and comparison internetarchive/openlibrary#635 feeling a bit silly for picking an already fixed issue, but it's done now!
    openlibrayr-lite is looking nice with the carousels now!
    rajbot
    @rajbot
    Well, one blocker on getting login credentials via XHR is that OL doesn't present CORS headers, so my attempt is blocked by the browser...
    Failed to load https://openlibrary.org/account/login: Redirect from 'https://openlibrary.org/account/login' to 'https://openlibrary.org/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost.openlibrary.org:3000' is therefore not allowed access.
    Richard Caceres
    @rchrd2_twitter
    hmm. workarounds?
    rajbot
    @rajbot
    super cool!
    Charles Horn
    @hornc
    not much, but a PR nevertheless, ArchiveLabs/openlibrary-lite#4
    Richard Caceres
    @rchrd2_twitter
    Cool thanks! PR's welcome
    rajbot
    @rajbot
    Maybe the easiest thing for the login is to just change the openlibrary.org login cookie to be valid for .openlibrary.org, so it works on subdomains. Then put OL lite on m.openlibrary.org and use the same login page
    rajbot
    @rajbot
    i'm gonna go take the kid to get food
    Richard Caceres
    @rchrd2_twitter
    hmm. okay. thanks.
    maybe we can ask mek to setup cors on dev.ol for testing
    Charles Horn
    @hornc
    another small PR: ArchiveLabs/openlibrary-lite#5
    Charles Horn
    @hornc
    thanks to the organisers for making all the talks available online! it's been a good experience for remotes! :clap:
    Richard Caceres
    @rchrd2_twitter
    For those working on openlibrary-lite, I merged the changes into master. So now master it the main branch.