mudler / LocalAI

:robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. Features: Generate Text, Audio, Video, Images, Voice Cloning, Distributed, P2P inference
https://localai.io
MIT License
26.46k stars 1.98k forks source link

feat: add WebUI API token authorization #4197

Closed mintyleaf closed 1 week ago

mintyleaf commented 1 week ago

Description

This PR fixes #2227 (tracked in #2156) I've added a simple (we can't use fancy template resources without auth) html login page for token input, which pushes xhr request to the new /login handler, which is sets a 24hr valid cookie for a token. The v2keyauth is now looking for token field in cookies too.

Notes for Reviewers

Signed commits

netlify[bot] commented 1 week ago

Deploy Preview for localai ready!

Name Link
Latest commit 7e66ec894c99a6c056b62e009cebca77ddd1134b
Latest deploy log https://app.netlify.com/sites/localai/deploys/673cb2f7dd29f20008556b92
Deploy Preview https://deploy-preview-4197--localai.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

mudler commented 1 week ago

This is looking nice, thank you! just few small nits