This worker uses both cookie and basic authentication by creating a __session
cookie and encrypts with AES-CBC
after initial login via basic authentication.
While the cookie is valid, the annoying browser basic authentication popup won't be triggered again even you close browser or device like in normal session based authentications.
Also, you can visit https://{WORKER_URL}/logout
page for manually logout and deleting cookie.
- Change worker
name
inwrangler.toml
according to your worker. - Create environment variables that you see below.
- Type
wranger publish
from your favorite terminal. - (Optional) Change cookie
MAX_AGE
, name and basic authenticationREALM
insrc/index.ts
.
USERNAME
: for admin usernamePASSWORD
: for admin passwordSECRET_KEY
: for cookie encryption.