Answer the question
In order to leave comments, you need to log in
How to implement a WP based backend for authorization and using wp functions in a React native app?
The first thing that comes to mind, and the simplest, is to file the API on the WP side and simply authorize it on each request. But these are unnecessary actions and there is no protection on the client side. Plus, it's not clear how cookies work.
function user_auth($user_id){
$user = get_user_by( 'id', $user_id );
if( $user ) {
wp_set_auth_cookie( $user_id, true );
wp_set_current_user( $user_id, $user->user_login );
}
}
Answer the question
In order to leave comments, you need to log in
Here is part of the answer:
https ://anatolykulikov.ru/article/multilingual-plu...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question