-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Login (no widget) Does not work with WooCommerce My Account Login #45
Comments
It looks like WooCommerce has it's own login form that is not using the Auth0 backend. From woocommerce/templates/myaccount/form-login.php: <form method="post" class="login">
<?php do_action( 'woocommerce_login_form_start' ); ?>
<p class="form-row form-row-wide">
<label for="username"><?php _e( 'Username or email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="username" id="username" value="<?php if ( ! empty( $_POST['username'] ) ) echo esc_attr( $_POST['username'] ); ?>" />
</p>
<p class="form-row form-row-wide">
<label for="password"><?php _e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
<input class="input-text" type="password" name="password" id="password" />
</p>
<?php do_action( 'woocommerce_login_form' ); ?>
<p class="form-row">
<?php wp_nonce_field( 'woocommerce-login' ); ?>
<input type="submit" class="button" name="login" value="<?php _e( 'Login', 'woocommerce' ); ?>" />
<label for="rememberme" class="inline">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woocommerce' ); ?>
</label>
</p>
<p class="lost_password">
<a href="<?php echo esc_url( wc_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'woocommerce' ); ?></a>
</p>
<?php do_action( 'woocommerce_login_form_end' ); ?>
</form> |
I believe you need to hook for this event: $creds['user_password'] = $_POST['password'];
$creds['remember'] = isset( $_POST['rememberme'] );
$secure_cookie = is_ssl() ? true : false;
$user = wp_signon( apply_filters( 'woocommerce_login_credentials', $creds ), $secure_cookie );
if ( is_wp_error( $user ) ) {
throw new Exception( $user->get_error_message() );
} else { |
This is one idea at a solution: https://github.com/auth0/wp-auth0/compare/auth0:master...cancan101:login_woo?expand=1 |
Hey @cancan101 I have been working on WooCommerce support. Thanks |
I selected "Auto Login (no widget)" but the "My Account" page on WooCommerce shows:
and I am unable to use an email/password here that works with the select Auth0 connection.
related: https://ask.auth0.com/t/auth0-plugin-for-wp-not-fully-replacing-normal-login/794
The text was updated successfully, but these errors were encountered: