Opening password protected site (Passport.js) with Phantom.Js by setting cookie

前端 未结 1 1672
猫巷女王i
猫巷女王i 2021-01-15 22:17

I am trying to access a passport protected page of my Express.js app with a Phantom.js script.

How can I simulate a logged in user w

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 22:35

    using javascript, you should be able to fill in your login fields and submit. (simulating a user login, not trying to recreate a login cookie)

    that would probably be your best bet.

    for how to fill in forms, see: How to fill in form field, and submit, using javascript? Automatic form fill using javascript

    0 讨论(0)
提交回复
热议问题