Skip to content

Commit 2ace85b

Browse files
authored
Merge pull request #849 from masteradhoc/readme-documentation-redirect
docs: document login_redirect filter for post-2FA redirect (#278)
2 parents 60bbc01 + 6cafd30 commit 2ace85b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

readme.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ Here is a list of action and filter hooks provided by the plugin:
103103
- `two_factor_after_authentication_input`action which receives the provider object and fires after the input shown on the authentication input form (if form contains no input, action fires immediately after `two_factor_after_authentication_prompt`).
104104
- `two_factor_login_backup_links` filters the backup links displayed on the two-factor login form.
105105

106+
== Redirect After the Two-Factor Challenge ==
107+
108+
To redirect users to a specific URL after completing the two-factor challenge, use WordPress Core built-in login_redirect filter. The filter works the same way as in a standard WordPress login flow:
109+
110+
add_filter( 'login_redirect', function( $redirect_to, $requested_redirect_to, $user ) {
111+
return home_url( '/dashboard/' );
112+
}, 10, 3 );
113+
106114
== Frequently Asked Questions ==
107115

108116
= What PHP and WordPress versions does the Two-Factor plugin support? =

0 commit comments

Comments
 (0)