Info
- 10 posts
- 5 voices
- Started 1 year ago by nehagoyal
- Latest reply from Ben L.
function bb_auth
-
- Posted 1 year ago #
for what purpose the function bb_auth is used and what value is passed to argument $scheme
-
- Posted 1 year ago #
function bb_auth( $scheme = 'auth' ) { // Checks if a user has a valid cookie, if not redirects them to the main page }I'm guessing it "Checks if a user has a valid cookie, if not redirects them to the main page"
First link on google
-
- Posted 1 year ago #
1.x supports SSL so scheme can also be for SSL 'secure_auth'
I guess the idea is to use a different cookie than the one exposed via http.
-
- Posted 1 year ago #
There's also
bb_auth( 'logged_in' )if you aren't checking if the user can be in bb-admin. -
- Posted 1 year ago #
@Ben
Didn't get your point. I can't see that in file eitherfunctions.bb-pluggable.php -
- Posted 1 year ago #
bb_auth()can be called with'logged_in'as the$schemeto check if a user is logged in. -
- Posted 1 year ago #
but there is nothing in the function definition for an argument
'logged-in'
how did you get that? -
- Posted 1 year ago #
@ashfame
in the function bb_salt($scheme), there are 4 cases for the variable $scheme one of which checks for the value 'logged_in' (all are auth, secure_auth, logged_in, nonce) -
- Posted 1 year ago #
@nehagoyal
and we are talking ofbb_auth()here. Aren't we? -
- Posted 1 year ago #
bb_authcallsbb_validate_auth_cookie, which callsWP_Auth::validate_auth_cookie, which uses a variable defined inbb-settings.php. The cookies you can check for are auth and logged_in, with auth automatically switching to secure_auth if you're on SSL. -
You must log in to post.