mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -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.
|
/// The list of oidc providers configured for this instance of kyoo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, OidcInfo> Oidc { get; set; }
|
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
|
public class OidcInfo
|
||||||
|
@ -38,6 +38,7 @@ public class InfoApi(PermissionOption options) : ControllerBase
|
|||||||
return Ok(
|
return Ok(
|
||||||
new ServerInfo()
|
new ServerInfo()
|
||||||
{
|
{
|
||||||
|
AllowGuests = options.Default.Any(),
|
||||||
Oidc = options
|
Oidc = options
|
||||||
.OIDC.Select(x => new KeyValuePair<string, OidcInfo>(
|
.OIDC.Select(x => new KeyValuePair<string, OidcInfo>(
|
||||||
x.Key,
|
x.Key,
|
||||||
|
@ -33,6 +33,10 @@ export const OidcInfoP = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const ServerInfoP = 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.
|
* The list of oidc providers configured for this instance of kyoo.
|
||||||
*/
|
*/
|
||||||
@ -42,7 +46,10 @@ export const ServerInfoP = z.object({
|
|||||||
Object.fromEntries(
|
Object.fromEntries(
|
||||||
Object.entries(x).map(([provider, info]) => [
|
Object.entries(x).map(([provider, info]) => [
|
||||||
provider,
|
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