How to keep a use logged in using react native
So im building a react-native app where people have to be logged in, how can i keep them logged in to the app/store their data locally so whenever they exit and reenter the app, they will be logged in unless they explicitly logged out?
See also questions close to this topic
-
React Native updated code of modules is not reflect in debug Android build
Whenever I publish any node module on my npm repo and take an update of that module in my main project then I use
npx react-native run-android
command to run debug build on my Android Device but my update code of the module did not run on my device.To run the updated code I have to go to node modules code files and press the
Ctrl+S
then the updated code is run on the Android Device. -
Trouble passing props from functional to functional component
I am passing props to a functional component, but I keep getting an error:
const renderItem = ({ item }) => ( <CommentCellClass key={item.key} commentLikes={item.commentLikes} .... more props
I try and access them in the CommentCellClass component:
const CommentCellClass = ({ props, navigation }) => { const { key, commentLikes } = props;
But I get the following error:
TypeError: undefined is not an object (evaluating 'props.key')]
What am I doing wrong? The props are not null (I checked before I passed them to commentCellClass)
Sorry for the confusing name (CommentCellClass is a functional component). We are in the process of converting the class components to functional components in our app.
-
Select and unselect component when one is selected
I've to display three components (cards) from which the user can select one. I've placed those three components inside a
ScrollView
as:... <ScrollView horizontal={true} showsHorizontalScrollIndicator={false}> <LocationAndPriceCard price={'100'} title={'Choice 3'} /> <LocationAndPriceCard price={'200'} title={'Choice 2'} /> <LocationAndPriceCard price={'300'} title={'Choice 1'}} /> </ScrollView> ...
Here is how
LocationAndPriceCard
is coded:... function LocationAndPriceCard({ price, title }) { const [selectedLocation, setSelectedLocation] = useState("red") const styles = getStyles(selectedLocation); const selected = () => { if (selectedLocation == "red") { setSelectedLocation("green") } else { setSelectedLocation("red") } } return ( <TouchableOpacity style={styles.frame} onPress={selected}> <Text style={styles.priceTxt}>RM {price}</Text> <Text style={styles.title} numberOfLines={2}>{title}</Text> </TouchableOpacity> ); } const getStyles = (borderC) => StyleSheet.create({ frame: { borderWidth: 1, borderColor: borderC, width: 180, backgroundColor: '#fff', borderRadius: 8, margin: 5, padding: 10, }, ...
In the code above when the cad has selected it successfully change the border color to
green
but I can change the color of all the components. I want to make it like if one is selected all others should go back tored
color. -
How to read text file separated by spaces and uncertain amount of data in C++?
I have an input file to represent the unique id of a product and the number of products in 4 different storages. Availability could be empty or 4 (There is no situation where the product goes empty in 1st storage before 2nd, 3rd, and 4th). A demo file looks like below:
1 20 11 2 // 1 is id, 20-> 1st storage, 11-> 2nd storage, 2-> 3rd storage, 4th-> ignore 2 3 12 10 4 9 5 10 2
I have a data structure to store products as below:
struct ProductDetails { size_t id; vector<size_t> availability; }
I wish to read the file and store all
ProductDetails
into avector<ProductDetails>
. Theavailability
vector could be empty or with 4 elements. How to handle this uncertainty while reading the file?friend std::istream& operator>>(std::istream& str, ProductDetails& data) { std::string line; ProductDetails tmp; if (std::getline(str,line)) { std::stringstream iss(line); // How to read and store tmp here? } return str; }
Finally, I am filling in product data to vector as below:
ifstream readFile("textfile.txt"); ProductDetails data; while(readFile >> data) { // Do Stuff }
-
Trying to write data from list into an file Python
Hi guys so I am trying to write data from a list into a file and kinda struggling with it.
I am calling writeToFasta in the fileIterator method and the variable e is a list of SeqObjects and I want to use those into the function writeToFasta so it writes and appends everything in the file
But It only writes the last element of data into the file
def writeToFasta(arr,outputFile): SeqIO.write(arr, f"{outputFile}.fasta", "fasta") def fileIterator(fileNameArr): for fileName in fileNameArr: dataParse = fileParser(fileName) e = endProduct(torun,dataParse) for s in e: writeToFasta(s,"NewFileName") fileIterator(fileN)
-
/sdcard/.... no such file or directory in uploading a file to android studio application
hello I'm trying to upload a file to my application and on some devices for uploading from sdcard it gives me an error:(path) no such file or directory. anybody have any idea why?? My code:
browsing file and opening file manager:
private void doBrowseFile() { Intent chooseFileIntent = new Intent(Intent.ACTION_GET_CONTENT); chooseFileIntent.setType("application/pdf"); // Only return URIs that can be opened with ContentResolver chooseFileIntent.addCategory(Intent.CATEGORY_OPENABLE); chooseFileIntent = Intent.createChooser(chooseFileIntent, "Choose a file"); startActivityForResult(chooseFileIntent, UNIQUE_REQUEST_CODE); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == UNIQUE_REQUEST_CODE) { if (resultCode == RESULT_OK) { if (data != null) { Uri fileUri = data.getData(); Log.i(LOG_TAG, "Uri: " + fileUri); String filePath = null; try { filePath = FileUtils.getPath(this, fileUri); } catch (Exception e) { Log.e(LOG_TAG, "Error: " + e); Toast.makeText(this, "Error: " + e, Toast.LENGTH_SHORT).show(); } getBase64FromPath(filePath); } } } super.onActivityResult(requestCode, resultCode, data); }
Encoding file from file path:
@RequiresApi(api = Build.VERSION_CODES.O) public void getBase64FromPath(String path) { String base64 = ""; try { File file = new File(path); byte[] buffer = new byte[(int) file.length() + 100]; @SuppressWarnings("resource") int length = new FileInputStream(file).read(buffer); base64 = Base64.encodeToString(buffer, 0, length, Base64.DEFAULT); uploadFile(base64); } catch (IOException e) { Toast.makeText(this, "error:" + e.getMessage() , Toast.LENGTH_SHORT).show(); //I get the error here } }
If anybody know any idea why please tell. It gives this error on some devices only. on the others it works perfectly fine. thanks.
-
pdftk command to disable software printing
I know that using pdftk we can disable or allow printing of PDF. But what I really want to do is allow printing from hardware but disable software printing like Adobe reader print to PDF or Microsoft print to PDF. Because software printing removes protection control over PDF.
If pdftk can't do it then is there any command line which can protect PDF. Thanks.
-
getDeviceId: The user 10214 does not meet the requirements to access device identifiers
I have an issue with permission.
Splah
package com.xitij.spintoearn.Activity; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.telephony.TelephonyManager; import android.util.Log; import android.view.Window; import android.view.WindowManager; import android.widget.Toast; import com.facebook.ads.AudienceNetworkAds; import com.gun0912.tedpermission.PermissionListener; import com.gun0912.tedpermission.TedPermission; import com.xitij.spintoearn.Models.Settings; import com.xitij.spintoearn.Models.User; import com.xitij.spintoearn.R; import com.xitij.spintoearn.Util.Constant; import com.xitij.spintoearn.Util.Ex; import com.xitij.spintoearn.Util.Method; import com.xitij.spintoearn.Util.RestAPI; import com.loopj.android.http.AsyncHttpClient; import com.loopj.android.http.AsyncHttpResponseHandler; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.List; import cz.msebera.android.httpclient.Header; public class Splash extends AppCompatActivity { private static int SPLASH_TIME_OUT = 2000; private Constant constant; private String GetDeviceID(){ TelephonyManager tm=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String deviceID = null; int readIMEI= ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE); if(deviceID == null) { if (readIMEI == PackageManager.PERMISSION_GRANTED) { deviceID = tm.getDeviceId().toString(); } } return deviceID; } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); AudienceNetworkAds.initialize(this); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_splash); PermissionListener permissionlistener = new PermissionListener() { @Override public void onPermissionGranted() { Constant.DeviceID = GetDeviceID(); login(Constant.DeviceID); //Toast.makeText(Splash.this, "Permission Granted", Toast.LENGTH_SHORT).show(); } @Override public void onPermissionDenied(List<String> deniedPermissions) { finish(); } }; TedPermission.with(this) .setPermissionListener(permissionlistener) .setDeniedMessage("If you reject permission,you can not use this service\n\nPlease turn on permissions at [Setting] > [Permission]") .setPermissions(Manifest.permission.READ_PHONE_STATE, Manifest.permission.ACCESS_NETWORK_STATE,Manifest.permission.RECORD_AUDIO) .check(); constant = new Constant(Splash.this); Constant.DeviceID = GetDeviceID(); Ex.getIPaddress(); if(Ex.isConnectionEnable(this) && Ex.checkAndRequestPermissions(this,this)){ new Handler().postDelayed(new Runnable() { @Override public void run() { //login(Constant.DeviceID); } },SPLASH_TIME_OUT); } } public void login(final String deviceid) { String login = RestAPI.API_Device_Login + "&deviceid=" + deviceid; AsyncHttpClient client = new AsyncHttpClient(); client.get(login, null, new AsyncHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { Log.d("Response", new String(responseBody)); String res = new String(responseBody); try { JSONObject jsonObject = new JSONObject(res); JSONArray jsonArray = jsonObject.getJSONArray(Constant.AppSid); for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = jsonArray.getJSONObject(i); String success = object.getString("success"); if (success.equals("1")) { String user_id = object.getString("user_id"); String name = object.getString("name"); String sendEmail = object.getString("email"); String userPhone = object.getString("phone"); String userCode = object.getString("user_code"); constant.sharedEditor.putBoolean(constant.isLogin, true); constant.sharedEditor.putString(constant.profileId, user_id); constant.sharedEditor.putString(constant.userName, name); constant.sharedEditor.putString(constant.userEmail, sendEmail); constant.sharedEditor.putString(constant.userPhone, userPhone); constant.sharedEditor.putString(constant.userCode, userCode); constant.sharedEditor.commit(); LoadSettings(); Constant.user =new User("00",name,sendEmail,"000",userPhone,userCode); Method.UserLoginLogs(user_id,"Login",Constant.DeviceID); Intent intent=new Intent(getBaseContext(),MainActivity.class); startActivity(intent); finish(); } else { Intent inst = new Intent(Splash.this, Login.class); inst.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(inst); finish(); // Ex.okAlertBox(getResources().getString(R.string.login_failed_message)); //Toast.makeText(Login.this, getResources().getString(R.string.login_failed), Toast.LENGTH_SHORT).show(); } } } catch (JSONException e) { e.printStackTrace(); } } @Override public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Splash.this); alertDialogBuilder.setTitle("Server Maintenance"); alertDialogBuilder.setMessage("System is Undergoing Maintenance. Please try again later."); alertDialogBuilder.setPositiveButton(getApplication().getResources().getString(R.string.ok_message), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { finish(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } }); } public void LoadSettings() { AsyncHttpClient client = new AsyncHttpClient(); client.get(RestAPI.API_Settings, null, new AsyncHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { Log.d("Response-ls", new String(responseBody)); String res = new String(responseBody); try { JSONObject jsonObject = new JSONObject(res); JSONArray jsonArray = jsonObject.getJSONArray(Constant.AppSid); for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = jsonArray.getJSONObject(i); String app_name = object.getString("app_name"); String app_logo = object.getString("app_logo"); String app_version = object.getString("app_version"); String app_author = object.getString("app_author"); String app_contact = object.getString("app_contact"); String app_email = object.getString("app_email"); String app_website = object.getString("app_website"); String app_description = object.getString("app_description"); String app_developed_by = object.getString("app_developed_by"); String app_faq = object.getString("app_faq"); String app_privacy_policy = object.getString("app_privacy_policy"); String publisher_id = object.getString("publisher_id"); boolean interstital_ad = Boolean.parseBoolean(object.getString("interstital_ad")); String interstital_ad_id = object.getString("interstital_ad_id"); String interstital_ad_click = object.getString("interstital_ad_click"); boolean banner_ad = Boolean.parseBoolean(object.getString("banner_ad")); String banner_ad_id = object.getString("banner_ad_id"); boolean rewarded_video_ads = Boolean.parseBoolean(object.getString("rewarded_video_ads")); String rewarded_video_ads_id = object.getString("rewarded_video_ads_id"); String redeem_currency = object.getString("redeem_currency"); String redeem_points = object.getString("redeem_points"); String redeem_money = object.getString("redeem_money"); String minimum_redeem_points = object.getString("minimum_redeem_points"); String payment_method1 = object.getString("payment_method1"); String payment_method2 = object.getString("payment_method2"); String payment_method3 = object.getString("payment_method3"); String payment_method4 = object.getString("payment_method4"); String daily_spin_limit = object.getString("daily_spin_limit"); String ads_frequency_limit= object.getString("ads_frequency_limit"); String video_add_point= object.getString("video_add_point"); String app_refer_reward= object.getString("app_refer_reward"); String registration_reward= object.getString("registration_reward"); String video_ads_limit= object.getString("daily_rewarded_video_ads_limits"); Constant.settings = new Settings(app_name, app_logo, app_version, app_author, app_contact, app_email, app_website, app_description, app_developed_by, app_faq, app_privacy_policy, publisher_id, interstital_ad_id, interstital_ad_click, banner_ad_id, rewarded_video_ads_id, redeem_currency, redeem_points, redeem_money, minimum_redeem_points, payment_method1, payment_method2, payment_method3, payment_method4, interstital_ad, banner_ad, rewarded_video_ads,daily_spin_limit,ads_frequency_limit,video_add_point,app_refer_reward,registration_reward,video_ads_limit); Log.d("Response-ls",ads_frequency_limit ); } } catch (JSONException e) { e.printStackTrace(); } } @Override public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) { } }); } }
logcat
2021-03-08 08:05:02.525 14296-14296/? E/itij.spintoear: Unknown bits set in runtime_flags: 0x8000 2021-03-08 08:05:04.622 14296-14296/com.xitij.spintoearn E/fdsan: attempted to close file descriptor 74, expected to be unowned, actually owned by FILE* 0x76c3b37018 2021-03-08 08:05:04.758 14296-14296/com.xitij.spintoearn E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xitij.spintoearn, PID: 14296 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xitij.spintoearn/com.xitij.spintoearn.Activity.Splash}: java.lang.SecurityException: getDeviceId: The user 10214 does not meet the requirements to access device identifiers. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3408) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3547) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2080) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:264) at android.app.ActivityThread.main(ActivityThread.java:7581) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980) Caused by: java.lang.SecurityException: getDeviceId: The user 10214 does not meet the requirements to access device identifiers. at android.os.Parcel.createException(Parcel.java:2071) at android.os.Parcel.readException(Parcel.java:2039) at android.os.Parcel.readException(Parcel.java:1987) at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:10389) at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:1620) at com.xitij.spintoearn.Activity.Splash.GetDeviceID(Splash.java:53) at com.xitij.spintoearn.Activity.Splash.onCreate(Splash.java:99) at android.app.Activity.performCreate(Activity.java:7805) at android.app.Activity.performCreate(Activity.java:7794) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3378) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3547) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2080) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:264) at android.app.ActivityThread.main(ActivityThread.java:7581) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
-
How can I validate google recaptcha on the server side?
I have a contact form and I'm trying to validate google's Recaptcha on the server-side. My HTML form looks like this:
<div class="container-contact100"> <div class="wrap-contact100"> <form class="contact100-form validate-form" action="form.php" method="POST"> <span class="contact100-form-title"> Contact Us </span> <div class="wrap-input100 validate-input" data-validate="Name is required"> <input class="input100" type="text" name="name" placeholder="Full Name"> <span class="focus-input100-1"></span> <span class="focus-input100-2"></span> </div> <div class="wrap-input100 validate-input" data-validate = "Valid email is required: ex@abc.xyz"> <input class="input100" type="text" name="email" placeholder="Email"> <span class="focus-input100-1"></span> <span class="focus-input100-2"></span> </div> <div class="wrap-input100 validate-input" data-validate = "Message is required"> <textarea class="input100" name="message" placeholder="Tell us what kind of quote you're looking for"></textarea> <span class="focus-input100-1"></span> <span class="focus-input100-2"></span> </div> <!-- This is google's test sitekey. --> <div class="g-recaptcha" data-sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"></div> <div class="container-contact100-form-btn"> <button class="contact100-form-btn"> Submit </button> </div> </form> </div> </div>
I've already validated this on the client side. But I'm trying to also validate this on the server side. I have PHP code that is attempting to validate it, which is:
<?php $captcha; echo '<script>alert("Welcome to Geeks for Geeks")</script>'; if(isset($_POST['g-recaptcha-response'])){ $captcha=$_POST['g-recaptcha-response']; } if(!$captcha){ echo '<h2>Please check the the captcha form.</h2>'; exit; } $secretKey = "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe"; // This is google's test key for recaptcha $ip = $_SERVER['REMOTE_ADDR']; // post request to server $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha); $response = file_get_contents($url); $responseKeys = json_decode($response,true); // should return JSON with success as true if($responseKeys["success"]) { echo '<h2>Thanks for posting comment</h2>'; } else { echo '<h2>You are spammer ! Get the @$%K out</h2>'; } ?>
However, it doesn't seem to work. Whenever I submit the form, it just goes to a blank page. What am I doing wrong? How can I get it validated?
-
validate username from database table before registration - LARAVEL
I'm trying to validate every user that will register if their username/employee number is existing in the master list.
If it does not exist, an error will be shown. If exists, the registration will enter another validation
Controller:
return Validator::make( [ 'employeenumber' => 'required|max:9|unique:users|alpha_dash|exists:masterlist', 'name' => 'required', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:6|max:30|confirmed', 'password_confirmation' => 'required|same:password', ], [ 'employeenumber.exists' => trans('auth.EmployeeNumberNull'), 'employeenumber.unique' => trans('auth.EmployeeNumber'), 'employeenumber.required' => trans('auth.EmployeeNumberRequired'), 'name.required' => trans('auth.AccNameRequired'), 'email.required' => trans('auth.emailRequired'), 'email.email' => trans('auth.emailInvalid'), 'password.required' => trans('auth.passwordRequired'), 'password.min' => trans('auth.PasswordMin'), 'password.max' => trans('auth.PasswordMax'), ]
Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'employeenumber' in 'where clause' (SQL: select count(*) as aggregate from `employees` where `employeenumber` = 03-444555) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22):
I get server error when registering employee number that is not on database instead of throwing an error.
-
How do I generate a '__RequestVerificationToken' in order to send a successful post request?
I am trying to authorize some activity on a website via a series of POST requests. The first post request will log in and get the cookie. The second will use this cookie to authorise the action.
I am using the Firefox network debugger to get the Fetch code for both of these requests.
// Logging in await fetch( URL, { credentials: "include", headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0", Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Content-Type": "application/x-www-form-urlencoded", "Upgrade-Insecure-Requests": "1", }, referrer: REFERRER, body: USERNAME&PASSWORD, method: "POST", mode: "cors", } ).then((res) => console.log(res)); // Clicking Authorize await fetch( URL, { credentials: "include", headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0", Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Content-Type": "application/x-www-form-urlencoded", "Upgrade-Insecure-Requests": "1", }, referrer: REFERRER, body: "__RequestVerificationToken=TOKEN_HERE&EXTRA_INFO_FOR_AUTHORISING_ACTIONS", method: "POST", mode: "cors", } ).then((res) => console.log(res.url));
I need a way to get or generate the '__RequestVerificationToken' from the original response. I noticed in the debugger that there is a '.ASPXAUTH' cookie, is it using this?
-
NuxtJs Auth with multiple strategies, endpoints getting overwritten
I am building a web app using NuxtJs and I am using nuxtjs/auth-next for OAuth authorization with Google and Facebook auth providers. I have configured post authorization endpoints to fetch token from backend, while it works when I just have one Strategy in nuxt config (either google or facebook), but when I have both then both logins are using the first strategy's endpoint. I have spent a lot of time on this, please share if you have any thoughts on how to resolve this. Thanks!
Here is my auth config in nuxt.config.js
auth: { strategies: { facebook: { responseType: "code", endpoints: { token: Config.HOST + "/api/social-login/facebook/", userInfo: Config.HOST + "/api/auth/user/" }, clientId: Config.FACEBOOK_CLIENT_ID, scope: ["public_profile", "email"], refreshToken: { property: "refresh_token", maxAge: 60 * 60 * 24 * 30 } }, google: { clientId: Config.GOOGLE_CLIENT_ID, responseType: "code", endpoints: { token: Config.HOST + "/api/social-login/google/", userInfo: Config.HOST + "/api/auth/user/" }, codeChallengeMethod: "", refreshToken: { property: "refresh_token", maxAge: 60 * 60 * 24 * 30 } } } }