feat: added new util to get the current user when needed. Middleware was adding authentication logic to all the routes. let's revisit if we can move the non-auth endpoints to a separate route.
refac: update the routes to use new helpers for verification and retrieving user
chore: added black for local formatting of py code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/311
**Author:** [@anuraagdjain](https://github.com/anuraagdjain)
**Created:** 12/28/2023
**Status:** ✅ Merged
**Merged:** 1/1/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `main` ← **Head:** `refac/auth-middleware`
---
### 📝 Commits (10+)
- [`a01b112`](https://github.com/open-webui/open-webui/commit/a01b112f7fb018131a77929bf8900c9878047c3e) feat(auth): add auth middleware
- [`39b8e44`](https://github.com/open-webui/open-webui/commit/39b8e4430ebe84c409163b9970145b0d7d53a36c) Merge branch 'main' into refac/auth-middleware
- [`bdd153d`](https://github.com/open-webui/open-webui/commit/bdd153d8f5d91487f8c7eca77c340c62b1073626) refac: use dependencies to verify token
- [`613053e`](https://github.com/open-webui/open-webui/commit/613053e46cedce1c6db104df2f356323ffc805a8) Merge branch 'refac/auth-middleware' of https://github.com/anuraagdjain/ollama-webui into refac/auth-middleware
- [`08c0d7a`](https://github.com/open-webui/open-webui/commit/08c0d7a9ec99dceeee0174da6b34f42a13457c0a) fix: merge conflicts
- [`2532cb1`](https://github.com/open-webui/open-webui/commit/2532cb1e700b3c4e4bfaa3209f8291dcced72c30) Merge branch 'main' of github.com:ollama-webui/ollama-webui into refac/auth-middleware
- [`60c801e`](https://github.com/open-webui/open-webui/commit/60c801ee2238555245b2ad64cc902d8f56a4ad8a) remove unused import in main
- [`9d251f1`](https://github.com/open-webui/open-webui/commit/9d251f1a1e6b6ffc57102dda4643d0204bba5dc1) Merge branch 'main' into refac/auth-middleware
- [`8cfc787`](https://github.com/open-webui/open-webui/commit/8cfc787c136ece34e0363b93677154f925b1901e) Merge branch 'main' into refac/auth-middleware
- [`2d323b3`](https://github.com/open-webui/open-webui/commit/2d323b31e1bae029566a44c0614ded96b2de2275) Merge branch 'main' into refac/auth-middleware
### 📊 Changes
**10 files changed** (+174 additions, -331 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/.gitignore` (+2 -1)
📝 `backend/apps/ollama/main.py` (+7 -3)
📝 `backend/apps/web/main.py` (+3 -5)
📝 `backend/apps/web/models/users.py` (+0 -10)
📝 `backend/apps/web/routers/auths.py` (+12 -25)
📝 `backend/apps/web/routers/chats.py` (+36 -97)
📝 `backend/apps/web/routers/modelfiles.py` (+63 -115)
📝 `backend/apps/web/routers/users.py` (+31 -61)
📝 `backend/requirements.txt` (+2 -0)
📝 `backend/utils/utils.py` (+18 -14)
</details>
### 📄 Description
refac: use dependencies to verify token
- feat: added new util to get the current user when needed. Middleware was adding authentication logic to all the routes. let's revisit if we can move the non-auth endpoints to a separate route.
- refac: update the routes to use new helpers for verification and retrieving user
- chore: added black for local formatting of py code
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/311
Author: @anuraagdjain
Created: 12/28/2023
Status: ✅ Merged
Merged: 1/1/2024
Merged by: @tjbck
Base:
main← Head:refac/auth-middleware📝 Commits (10+)
a01b112feat(auth): add auth middleware39b8e44Merge branch 'main' into refac/auth-middlewarebdd153drefac: use dependencies to verify token613053eMerge branch 'refac/auth-middleware' of https://github.com/anuraagdjain/ollama-webui into refac/auth-middleware08c0d7afix: merge conflicts2532cb1Merge branch 'main' of github.com:ollama-webui/ollama-webui into refac/auth-middleware60c801eremove unused import in main9d251f1Merge branch 'main' into refac/auth-middleware8cfc787Merge branch 'main' into refac/auth-middleware2d323b3Merge branch 'main' into refac/auth-middleware📊 Changes
10 files changed (+174 additions, -331 deletions)
View changed files
📝
backend/.gitignore(+2 -1)📝
backend/apps/ollama/main.py(+7 -3)📝
backend/apps/web/main.py(+3 -5)📝
backend/apps/web/models/users.py(+0 -10)📝
backend/apps/web/routers/auths.py(+12 -25)📝
backend/apps/web/routers/chats.py(+36 -97)📝
backend/apps/web/routers/modelfiles.py(+63 -115)📝
backend/apps/web/routers/users.py(+31 -61)📝
backend/requirements.txt(+2 -0)📝
backend/utils/utils.py(+18 -14)📄 Description
refac: use dependencies to verify token
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.