Skip to content

Allow disabling automatically added verification hook on registration #4437

Description

@David-Wobrock

Preflight checklist

Ory Network Project

No response

Describe your problem

With our usage of Kratos, we have email verification enabled because we allow doing it in certain circumstances.

However, we do not want to trigger email verification post-registration (the same applies to post-settings, but we don't use it).

We would like a way to disable injected the email verification hook, but still keep the email verification feature globally enabled.

// WARNING - If you remove this, no verification emails / sms will be sent post-registration.
if m.Config().SelfServiceFlowVerificationEnabled(ctx) {
hooks = slices.Insert(hooks, 0, registration.PostHookPostPersistExecutor(m.HookVerifier()))
}

Describe your ideal solution

If we didn't take into account any past, the ideal solution would be that no hooks are added by the code in a hard-coded manner, but that the hooks need to be configured manually.

However, to avoid introducing a breaking change, I guess introducing a new config variable that allows disabling this automatic adding of the hook would be best.

Workarounds or alternatives

In our current forked version of Kratos, we plainly removed adding the LOC that adds the hook.

Version

v1.3.1

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or request.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions