package components import ( "context" "fmt" "time" "github.com/starfleetcptn/gomft/internal/db" ) // formatTime formats a time.Time value as a human-readable string func formatTime(t time.Time) string { return t.Format("Jan 02, 2006 15:04") } templ AuthProviders(ctx context.Context, providers []db.AuthProvider) { @LayoutWithContext("Authentication Providers", ctx) {

Authentication Providers

Manage external authentication sources like Authentik, OIDC, SAML, etc.

New Provider
if len(providers) > 0 {
for _, provider := range providers { }
Name Icon Type Status Provider URL Last Used Actions
{ provider.Name }
if provider.IconURL != "" { { } else { if provider.Type == db.ProviderTypeAuthentik { Authentik } else if provider.Type == db.ProviderTypeOIDC { OIDC } else if provider.Type == db.ProviderTypeSAML { SAML } else if provider.Type == db.ProviderTypeOAuth2 { OAuth2 } else { } }
{ string(provider.Type) } if provider.Enabled { Active } else { Disabled } { provider.ProviderURL } if provider.LastUsed.Valid { { formatTime(provider.LastUsed.Time) } } else { Never }
Edit
} else {

No Authentication Providers

You haven't set up any external authentication providers yet.

Add First Provider
}

Authentication providers allow users to sign in using external identity providers.

Make sure to configure callback URLs in your provider's settings.

Test your connections to ensure proper communication with external authentication systems.

} }