diff --git a/.env.example b/.env.example index c433d1dd..8611f813 100644 --- a/.env.example +++ b/.env.example @@ -13,12 +13,15 @@ LIBRARY_IGNORE_PATTERN=".*/[dD]ownloads?/.*" # If this is true, new accounts wont have any permissions before you approve them in your admin dashboard. REQUIRE_ACCOUNT_VERIFICATION=true -# Specify permissions of guest accounts, default is no permissions but you can allow anyone to use your instance without account by doing: +# Specify permissions of guest accounts, default is no permissions. +UNLOGGED_PERMISSIONS= +# but you can allow anyone to use your instance without account by doing: # UNLOGGED_PERMISSIONS=overall.read,overall.play # You can specify this to allow guests users to see your collection without behing able to play videos for example: # UNLOGGED_PERMISSIONS=overall.read + # Specify permissions of new accounts. -# DEFAULT_PERMISSIONS=overall.read,overall.play +DEFAULT_PERMISSIONS=overall.read,overall.play # Hardware transcoding (equivalent of --profile docker compose option). COMPOSE_PROFILES= # vaapi or qsv or nvidia @@ -40,8 +43,8 @@ PUBLIC_URL=http://localhost:5000 # Use a builtin oidc service (google or discord): # When you create a client_id, secret combo you may be asked for a redirect url. You need to specify https://YOUR-PUBLIC-URL/api/auth/logged/YOUR-SERVICE-NAME -# OIDC_DISCORD_CLIENTID= -# OIDC_DISCORD_SECRET= +OIDC_DISCORD_CLIENTID= +OIDC_DISCORD_SECRET= # Or add your custom one: OIDC_SERVICE_NAME=YourPrettyName OIDC_SERVICE_LOGO=https://url-of-your-logo.com diff --git a/back/src/Kyoo.Core/CoreModule.cs b/back/src/Kyoo.Core/CoreModule.cs index 24138b52..d343bd72 100644 --- a/back/src/Kyoo.Core/CoreModule.cs +++ b/back/src/Kyoo.Core/CoreModule.cs @@ -68,7 +68,7 @@ namespace Kyoo.Core builder.RegisterRepository(); builder.RegisterRepository(); builder.RegisterRepository(); - builder.RegisterRepository(); + builder.RegisterRepository().As(); builder.RegisterRepository(); builder .RegisterType() diff --git a/front/packages/ui/src/admin/users.tsx b/front/packages/ui/src/admin/users.tsx index c973ce81..6fa24836 100644 --- a/front/packages/ui/src/admin/users.tsx +++ b/front/packages/ui/src/admin/users.tsx @@ -30,6 +30,7 @@ import { SettingsContainer } from "../settings/base"; import UserI from "@material-symbols/svg-400/rounded/account_circle.svg"; import Delete from "@material-symbols/svg-400/rounded/delete.svg"; import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg"; +import Unverifed from "@material-symbols/svg-400/rounded/gpp_bad.svg"; import Admin from "@material-symbols/svg-400/rounded/shield_person.svg"; import { useMutation, useQueryClient } from "@tanstack/react-query"; @@ -39,8 +40,15 @@ export const UserGrid = ({ username, avatar, isAdmin, + isVerifed, ...props -}: WithLoading<{ id: string; username: string; avatar: string; isAdmin: boolean }>) => { +}: WithLoading<{ + id: string; + username: string; + avatar: string; + isAdmin: boolean; + isVerifed: boolean; +}>) => { const { css } = useYoshiki(); const { t } = useTranslation(); const queryClient = useQueryClient(); @@ -59,17 +67,35 @@ export const UserGrid = ({

{username}

+ {!isVerifed && ( + + mutateAsync({ + permissions: ["overall.read", "overall.play"], + }) + } + /> + )} { username={user.username} avatar={user.logo} isAdmin={user.permissions?.includes("admin.write")} + isVerified={user.permissions?.length == 0} /> )} diff --git a/front/translations/en.json b/front/translations/en.json index 8b050dfd..1e5d6708 100644 --- a/front/translations/en.json +++ b/front/translations/en.json @@ -228,7 +228,9 @@ "adminUser": "Admin", "regularUser": "User", "set-permissions": "Set permissions", - "delete": "Delete user" + "delete": "Delete user", + "unverifed": "Unverifed", + "verify": "Verify user" }, "scanner": { "label": "Scanner", diff --git a/front/translations/fr.json b/front/translations/fr.json index 258d4bd2..b1ddc2b8 100644 --- a/front/translations/fr.json +++ b/front/translations/fr.json @@ -228,7 +228,9 @@ "adminUser": "Admin", "regularUser": "Utilisateur", "set-permissions": "Definir les permissions", - "delete": "Supprimer l'utilisateur" + "delete": "Supprimer l'utilisateur", + "unverifed": "Non vérifié", + "verify": "Vérifié l'utilisateur" }, "scanner": { "label": "Scanner",