mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
Added couple more tries
This commit is contained in:
parent
c319b84d72
commit
d8a13ed29d
@ -239,13 +239,16 @@ async def check_user_exists(usr: UUID4) -> User:
|
||||
if LNBITS_ADMIN_UI:
|
||||
LNBITS_ADMIN_USERS = g().admin_conf.admin_users
|
||||
LNBITS_ALLOWED_USERS = g().admin_conf.allowed_users
|
||||
|
||||
if LNBITS_ALLOWED_USERS and g().user.id not in LNBITS_ALLOWED_USERS:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.UNAUTHORIZED, detail="User not authorized."
|
||||
)
|
||||
|
||||
if LNBITS_ADMIN_USERS and g().user.id in LNBITS_ADMIN_USERS:
|
||||
g().user.admin = True
|
||||
|
||||
try:
|
||||
if LNBITS_ALLOWED_USERS and g().user.id not in LNBITS_ALLOWED_USERS:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.UNAUTHORIZED, detail="User not authorized."
|
||||
)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if LNBITS_ADMIN_USERS and g().user.id in LNBITS_ADMIN_USERS:
|
||||
g().user.admin = True
|
||||
except:
|
||||
pass
|
||||
return g().user
|
||||
|
Loading…
Reference in New Issue
Block a user