Last active
June 14, 2019 11:15
-
-
Save robertuniqid/b598797253aabc21d823f22aa842e2c1 to your computer and use it in GitHub Desktop.
eLearnCommerce - Get Autologin Token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$salt = wpep_get_setting( 'auto-login-link-salt' ); | |
$user_token = get_user_meta( $user_id, WPEP_USER_META_AUTO_LOGIN_TOKEN, true ); | |
if( $user_token === '' || $regenerate_tokens ) { | |
$user_token = sha1( $salt . wpep_generate_random_token( 32 ) ); | |
update_user_meta( $user_id, WPEP_USER_META_AUTO_LOGIN_TOKEN, $user_token ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment