Socialite was working just fine until I updated to Laravel 5.5. I am getting a:
\Socialite\Two\InvalidStateException
The Whoops page error on line 209 from /Users/marcellopato/Sites/cepcar/vendor/laravel/socialite/src/Two/AbstractProvider.php:
if ($this->hasInvalidState()) {
throw new InvalidStateException;
}
Try this, I'm using Laravel 5.5:
return Socialite::driver('google')->stateless()->user();
https://laravel.com/docs/5.5/socialite#stateless-authentication
Related
I have x-cart site which is running from 4 years and suddenly product page is not working. we have not done any changes.
X-Cart DB Version: 4.1.9 GOLD
product page url : https://www.test.com/product.php?productid=40&cat=0&page=1&featured
I can see bellow error in log file "x-errors_php-190521.php"
PHP Fatal error:
Call to undefined function func_get_categories_list() in public_html/include/common.php on line 76
if (
!isset($cat)
|| $config['Appearance']['root_categories'] == 'Y'
) {
$categories = func_get_categories_list(0, false);
} else {
Line No 76: =>>> $categories = func_get_categories_list($cat, false);
}
so help us to solve this issue
1) Try to add the
x_load('category');
in the include/common.php right after the
case 'C':
line
2) Try to compare your product.php with the default one and localize the problem.
3) Try to compare your include/common.php with the default one and localize the problem.
4) Try to compare your include/categories.php with the default one and localize the problem.
5) Try to move x_load('category'); before the code switch ($current_area) {
6) Try to add the code include_once $xcart_dir . '/include/func/func.category.php'; before the code switch ($current_area) {
Key notes:
include/common.php was added in X-Cart 4.4.0
The func_get_categories_list function is defined in
include/categories.php file in X-Cart 4.1.9
The func_get_categories_list function is defined in
include/func/func.category.php file in X-Cart 4.4.0
It will be helpful to define the exact version of your files for that compare
files like include/func/func.core.php cart.php include/func/func.category.php include/func/func.order.php with the default ones.
I am trying to implement a form in ionic 2 and am having a problem with the skeleton code I have written. When running ionic serve it throws the error unexpected token on line 8 of the following code in my form.js file:
import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/common';
#Page({
templateUrl: 'build/pages/photo/photo.html',
})
export class PhotoPage {
constructor(form:FormBuilder){
this.submitMediaItem = {};
this.submitted = false;
this.name = new Control('', Validators.required);
}
Hi I had the same error previously. You can try this solution:
Check your version of ionic 2 using the command ionic -v. Mostly likely you are using the newer version of ionic 2 (mine is 2.0.0-beta.24).
For the earlier beta version, it uses typescript so form:FormBuilder is valid typescript but not valid javascript. The newer version has moved on with babel JS so you will need to do as such:
import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/common';
#Page({
templateUrl: 'build/pages/photo/photo.html'
})
export class PhotoPage {
static get parameters(){
return [FormBuilder];
}
constructor(form){
this.form = form; //or how ever you would like to use it
this.submitMediaItem = {};
this.submitted = false;
this.name = new Control('', Validators.required);
}
}
To return more than 1 parameters, you can do it as such:
return [[FormBuilder],[navController]];
constructor(form, nav){...}
There's a discussion thread regarding this error also: https://forum.ionicframework.com/t/cannot-resolve-all-parameters-error/44969/7
Hope this helps!
In the upgrade guide it states
Rails 4.0 removed the ActionController::Base.asset_path option. Use the assets pipeline feature.
I am currently in the process of upgrading from Rails 3.2 to Rails 4.1. In my app I use the select2-rails gem and in my js I add an image for the select menu options:
//mycode.js.erb
function format(image) {
var image_path = "<%= asset_path('" + image.id.toLowerCase() +"') %>"
return "<img class='flag' src='" + image_path + "' />";
}
The above worked in my Rails 3.2 app but I seemed to have broken it with my upgrade to 4.1 and now receive the following error:
Sprockets::FileNotFound - couldn't find file '" + image.id.toLowerCase() +"'
Is the asset_path helper still available in Rails 4.1? If yes, any ideas on where I may have gone wrong?
Update
The code above is in my .js.erb file which allows me to have Ruby code within my js file. This currently works well in my Rails 3.2 project. I am doing this as select2 allows us to format the display of our select menu items as per the below example:
//sample.js
function format(state) {
if (!state.id) return state.text; // optgroup
return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png'/>" + state.text;
}
My understanding was that it is correct usage to use the asset pipeline paths rather than manually adding something like 'assets/images/icons/small'
try {
$return = $facebook->api("/" . $userFromDB["username"] . "/feed",
"post", array(
message => "",
picture => "http://blabla.net/blabla1/img/autopost/" . $blabla2 . ".png",
link => "http://apps.facebook.com/blabla1/?var2=" . $encryptedUserIds[$userFromDB["id"]], //$appPageURL
caption => "Tikla, begen.",
description => $var3,
access_token => $auth["auth_code"],
));
$usersPosted++;
} catch (FacebookApiException $e) {
$userProcessError++;
write_log("blabla");
}
Hello, this is the part of the code where i send posts to users' wall. If there is no exception, the code works flawlessly. Whenever an exception occures, I get this annoying fatal error.
I have tried many things to correct but the script is the same where I make calls to facebook api in other parts of my code.
I searched google and stackoverflow. Noone seems to have this error. Am i the only one? Thanks in advance.
This is the error:
Fatal error: Call to undefined method Facebook::throwAPIException() in facebook-php-sdk/src/base_facebook.php on line 870
Facebook sdk version i use: 3.2
Php version: 5.3
EDIT: this is how i get access_token for user. I store it into db:
if(isset($code) && $state==$authState){
$accessTokenInformation=file_get_contents($accessTokenURL . $code);
$tmpResult=explode("&", $accessTokenInformation);
if(sizeof($tmpResult)==2){
$tmpAT=explode("=", $tmpResult[0]);
$tmpExp=explode("=", $tmpResult[1]);
if(sizeof($tmpAT)==2 && sizeof($tmpExp)==2){
$tmpDBUserAuth=check_db_for_authcode_for_user(...);
if(empty($tmpDBUserAuth)){
insert_authcode_indb(...);
write_log(...);
}else{
update_authcode_indb(...)
write_log(...);
}
}else{
write_log(...);
echo(' top.location.href="'. $OAuthURL .'"; ');
}
}else{
write_log(...);
echo(' top.location.href="'. $OAuthURL .'"; ');
}
}
EDIT on 2012/11/06: Problem still persists. Please help.
Please check you FB API secrete keys are proper set or not ... I also faced this problem , but i have corrected secrete keys after that it was working perfect.
Try to use the following script
http://www.9lessons.info/2011/09/update-login-with-facebook-and-twitter.html
Fatal error: Call to undefined method Facebook::throwAPIException() in facebook-php-sdk/src/base_facebook.php on line 870
That error message does not make sense.
If I go to line 870 in that file in my IDE, and follow the method name to its declaration, it’s in the same file on line 1237 (all for current version 3.2.0).
So there is no plausible reason for a undefined method error there.
Could you please check if the SDK files got uploaded correctly to your server, or just re-download and re-upload them, to make sure its not a problem with mangled/truncated file contents?
Can anyone help me with a Symfony 2 (I'm newby with it).
I just installed framework, created my own bundle and it worked fine till I switched template engine from Twig to PHP.
The steps I did:
specified templating: { engines: ['php', 'twig'] } in config.yml
renamed view file from hello.html.twig to hello.html.php
changed twig template code to php's echo
Also if inside the action I leave:
return $this->render('MyBundle:Default:index.html.php', array('name' => $name));
all OK, but when I changes it to:
return array('name' => $name);
Symfony shows me an error: Unable to find template "MyBundle:Default:index.html.twig"
I assume you use the #Template() annotation? From the official documentation:
If you are using PHP as a templating system, you need to make it
explicit::
/**
* #Template(engine="php")
*/
public function showAction($id)
{
// ...
}
So you should add engine="php" to the annotation.