mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
feat(login): use new IDP templates (#5315)
The login uses the new template based IDPs with backwards compatibility for old IDPs
This commit is contained in:
@@ -236,6 +236,23 @@ func (c *Commands) DeleteInstanceProvider(ctx context.Context, id string) (*doma
|
||||
return pushedEventsToObjectDetails(pushedEvents), nil
|
||||
}
|
||||
|
||||
func ExistsInstanceIDP(ctx context.Context, filter preparation.FilterToQueryReducer, id string) (exists bool, err error) {
|
||||
instanceWriteModel := NewInstanceIDPRemoveWriteModel(authz.GetInstance(ctx).InstanceID(), id)
|
||||
events, err := filter(ctx, instanceWriteModel.Query())
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if len(events) == 0 {
|
||||
return false, nil
|
||||
}
|
||||
instanceWriteModel.AppendEvents(events...)
|
||||
if err := instanceWriteModel.Reduce(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return instanceWriteModel.State.Exists(), nil
|
||||
}
|
||||
|
||||
func (c *Commands) prepareAddInstanceOAuthProvider(a *instance.Aggregate, writeModel *InstanceOAuthIDPWriteModel, provider GenericOAuthProvider) preparation.Validation {
|
||||
return func() (preparation.CreateCommands, error) {
|
||||
if provider.Name = strings.TrimSpace(provider.Name); provider.Name == "" {
|
||||
|
Reference in New Issue
Block a user