Facebook unable to live mode - facebook-login

I wanted to use Facebook Login to my website and unfortunately throws me error saying:
App not set up: This app is still in development mode, and you don't have access to it. Switch
to a registered test user or ask an app admin for permissions.
I've read some discussions that the app should be set from In Development to Live Mode, so I tried. However, switching to Live Mode requires me to provide my terms and privacy URL and I did provide the URL(https://example.com/terms-of-service, however I still cannot switch to Live mode.
While reading some docs, it says to check my URL for some errors using FB's tool https://developers.facebook.com/tools/debug
now I noticed I was missing some og meta tags, so I added this block of code in the <head> of my index.html like this:
<!-- og tags -->
<meta property="og:url" content="https://example.com" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Site's placeholder title" />
<meta property="og:description" content="Site's placeholder description" />
<meta property="og:image" content="https://mystoragebucket/mysiteimage.png" />
<meta property="fb:app_id" content="my_fb_app_id" />
and re-scrape the URL again. and for a brief sigh of relief, it was successful and didn't show me any errors and warnings.
Howevere, I still cannot switch to Live Mode. it still says :
Before switching to live mode, you must provide both a valid Privacy
Policy URL and data deletion information. Update this information in
Basic Settings on App Dashboard
Any idea on what I am missing here?
Facebook Login is quite annoying really.

And yet again, posting my problem on SO helps me solve my own problem x100.
For those who encounters the same issue, please read carefully like I didn't.
Data Deletion Callback URL
is the missing part. just add some URL and voila, your good to go.

Related

Django built-in server cannot decode URL parameters

I'm not sure if this is a Django-specific issue but right now I see it in my project.
Because browsers tend to cache favicon and I have changed them for my website, I came up with a trick to force anyone who have visited my site before to receive the new icons, adding "?" followed by some random characters to the image file name, so currently it is like this:
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png?v=Gv6qnaoWO5' %}">
Now the issue is, the favicon is not loading and when I check the source I see this:
<link rel="icon" type="image/png" sizes="32x32" href="/static/images/favicons/favicon-32x32.png%3Fv%3DGv6qnaoWO5">
and when I click on the above link, I get 404 error from django.views.static.serve. If I remove the "?" and rest of characters, everything works fine.
If memory serves, this is normal encoding of special characters and the web server should decode it, but this is not happening on Django's built-in server.
So, is there a fix for this, or I should wait until moving the site to production?
static takes a filename, and builds the URL. A filename doesn't have query parameters. Add the query parameters to it after the fact:
href="{% static 'images/favicons/favicon-32x32.png' %}?v=Gv6qnaoWO5">

getting Preconnect to required origins error in Lighthouse

I just moved my static website to AWS S3 + Cloudfront & Route 43. Once I deployed my site I ran Lighthouse & Pagespeed Insights and I'm getting "Preconnect to required origins Error!".
Before I moved my site I was not getting this error, so I'm thinking it has something to do with my AWS configuration. Here is my preconnects in my index.html file.
<link rel="preconnect" href="//www.google-analytics.com" crossorigin>
<link rel="preconnect" href="//fonts.googleapis.com" crossorigin>
<link rel="dns-prefetch" href="//fonts.googleapis.com">
I'm not connecting to any other 3rd parties, only Analytics & Google font. Am I missing a preconnect to cloudfront? I searched for a couple days online and have not found anything yet, so I'm here.
If you make requests directly to your Cloudfront domain, then you will need to preconnect to it too.
I'm not positive but should your href tag values start with https?

Issues with OpenCart cookies

I have moved my OpenCart store to a different host (by restoring CPanel backups - home directory, MySQL database, email forwarders), changed my config.php accordingly, and everything seemed to work normally on the front-end. However, I am experiencing some major issues that affect crucial parts of the store.
First off, whenever I try to log in to the admin panel I receive the following message (as a javascript 'alert' popup):
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
Followed by the raw HTML code of the admin login page:
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="UTF-8" />
<title>Administration</title>
<base href="https://[MY STORE URL]/admin/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
... etc
When I am trying to move around between different sections of the admin control panel I am constatly getting logged out, and receive the same error upon logging back in.
Moreover, user login and checkout are also broken. I can add products to the shopping cart as a guest and proceed to the checkout page, everything appears to be working, however when I put in registration details and press the checkout button, nothing happens (it is supposed to be redirecting to PayPal, as it does on my old host). I am using Journal 2 as my theme, which uses javascript to handle such buttons, so it shows no errors at all.
When I log in to my user account (as a customer) it only works for one page. If I move anywhere else on the website my account is getting logged out.
Based on the fact that I am unable to stay logged in my presumption is that the aforementioned issues have something to do with cookies.
Is there any way to resolve this?
I use OpenCart 2.3.0.2, and MariaDB 10.2.25-MariaDB-cll-lve - MariaDB Server (it differs from the initial host, which shows MySQL 5.6.45-cll-lve - MySQL Community Server (GPL)).
The error you get with alert:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
is from an ajax request that is made every-time you login / navigate inside the admin panel.
Steps to find the issue:
Before you login in the admin panel, right click in the browser and click "inspect element".
Choose tab "Network"
Login into the admin panel with your credentials.
Click ok at the alert of the error and then check into the network tab for the XHR (ajax) request made.
In the response sub-tab you will probably find a PHP exception. Find the cause of the error.
Important:
When a PHP error occurs while ajax request is made, the user token is "lost" so that's why you get logged out. It's not cookie related.
Hope the above helped you.

I cannot preview html in webstorm soft

I can not preview a html file in webstorm 9.0.1 when I run it, it shows web page is not available because in addressbar it shows localhost:63342/---project folder.---. How can I access from local harddisk html file.
And, another question can I preview html in google chrome/firefox as docable?
To access http://localhost you need to have running local server (like XAMPP or WAMPP). If you have no localhost server (or you have no idea if that thing exist in your computer) than you can't access http://localhost. That means any *.php file will be not usable.
If you are font-end developer, you don't need server. You can access your *.html files directly: file:///C:/path/to/file.html (in browser site url box). Also, for any external sources to work, path to that file must be relative:
//C://myProject
myProject
|-index.html
\
css
|-styles.css
\js
|-functions.js
You enter to browser url bar: file:///C://myProject/index.html
Your index.html looks like this:
<html>
<head>
<script src="js/functions.js"></script>
<-- WRONG:
<script src="http://localhost/js/functions.js"></script>
<script src="C:/myProject/js/functions.js"></script> // valid, but better to avoid
-->
</head>
</html>
To preview HTML file on disk (using file:/// protocol) in WebStorm, hold Shift when choosing a browser

What is the .. css source showing up in Chrome Inspector when using Zurb Foundation 4?

I'm using Foundation 4 (the Sass version) and most elements have styles applied to them that are coming from a source listed simply as ... When I click on it to see what it is I get the following:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>
What is this source? Shouldn't everything be compiled into foundation.css?
Check your server: If you put an image (foo.jpg) in your directory, can you open it and see it in your browser? I don't have enough details to help you (OS, server, ...) but you probably need to look this way. If the file aren't opening, you have problems in your server config or file permission!
(#admins : sorry, it should be a comment but it seems I don't have sufficient rep to reply to the comment)
I just noticed that whenever .. shows up in Inspector the line number shown matches that of thee selector in the .scss file. I have no idea how this works, or what exactly is responsible for this.
Oh! Just figured it out! It was the experimental SASS support feature which I had enabled in Chrome!
Mystery solved.