mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add allow guests to the server-info struct
This commit is contained in:
parent
c48ee975c6
commit
f4464578c0
@ -26,6 +26,11 @@ public class ServerInfo
|
||||
/// The list of oidc providers configured for this instance of kyoo.
|
||||
/// </summary>
|
||||
public Dictionary<string, OidcInfo> Oidc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// True if guest accounts are allowed on this instance.
|
||||
/// </summary>
|
||||
public bool AllowGuests { get; set; }
|
||||
}
|
||||
|
||||
public class OidcInfo
|
||||
|
@ -38,6 +38,7 @@ public class InfoApi(PermissionOption options) : ControllerBase
|
||||
return Ok(
|
||||
new ServerInfo()
|
||||
{
|
||||
AllowGuests = options.Default.Any(),
|
||||
Oidc = options
|
||||
.OIDC.Select(x => new KeyValuePair<string, OidcInfo>(
|
||||
x.Key,
|
||||
|
@ -33,6 +33,10 @@ export const OidcInfoP = z.object({
|
||||
});
|
||||
|
||||
export const ServerInfoP = z.object({
|
||||
/*
|
||||
* True if guest accounts are allowed on this instance.
|
||||
*/
|
||||
allowGuests: z.boolean(),
|
||||
/*
|
||||
* The list of oidc providers configured for this instance of kyoo.
|
||||
*/
|
||||
@ -42,7 +46,10 @@ export const ServerInfoP = z.object({
|
||||
Object.fromEntries(
|
||||
Object.entries(x).map(([provider, info]) => [
|
||||
provider,
|
||||
{ ...info, link: imageFn(`/auth/login/${provider}?redirectUrl=${baseAppUrl()}/login/callback`) },
|
||||
{
|
||||
...info,
|
||||
link: imageFn(`/auth/login/${provider}?redirectUrl=${baseAppUrl()}/login/callback`),
|
||||
},
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user