Laravel more time using token [closed] - forms

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I would like to know how can I remove token in form POST method because when I need between 10 and 15 min to fill a form and when I send it, I receive a token exception and I lost all my data.
Thank's for help

I wouldn't recommend removing the token. Instead increase the expiry time or after post redirect back with input values.
public function render($request, Exception $e)
{
if ($e instanceof \Illuminate\Session\TokenMismatchException) {
return redirect()->back()->withInput()->with('token', csrf_token());
}
return parent::render($request, $e);
}

Related

How to edit additional content in WooCommerce emails? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I would like to edit the additional content for specific WooCommerce emails. Is there any hook filter to do this?
I have just managed to change the Heading text with a filter woocommerce_email_heading_customer_completed_order.
I would also like to do this for the additional content.
You can use the 'woocommerce_email_additional_content_' . $this->id.
Here you find a complete list of email ids.
So in your case:
woocommerce_email_additional_content_customer_refunded_order for full refund
woocommerce_email_additional_content_customer_partially_refunded_order for partial refund
Try this:
// edit the additional content of the "Refunded order" email
add_filter( 'woocommerce_email_additional_content_customer_refunded_order', 'custom_additional_content_customer_refunded_order', 99, 3 );
add_filter( 'woocommerce_email_additional_content_customer_partially_refunded_order', 'custom_additional_content_customer_refunded_order', 99, 3 );
function custom_additional_content_customer_refunded_order( $content, $object, $email ) {
$content = 'Your personalized additional content';
return $content;
}
The code has been tested and works. Add it to your active theme's functions.php.

Facebook api('/me') not returning username [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am trying to implement a login with Facebook - thus far all is working, apart from the $user data I am being returned does not include the username (which I know does exist).
The array I am being returned is the following (with details purged):
Array ( [id] => ################ [email] => #.##############.co.uk [first_name] => ######## [gender] => male [last_name] => ######## [link] => https://www.facebook.com/app_scoped_user_id/################/ [locale] => en_GB [name] => ######## ######## [timezone] => 1 [updated_time] => 2014-05-06T21:23:33+0000 [verified] => 1 )
Has anyone had experience of this before?
The username field was removed in version 2.0 of the graph API. I'm not aware of any workaround (short of using version 1.0).
This change is listed in the "Removed Endpoints" section of the upgrade guide. You can also see that the "User" reference contains no mention of a username field for version 2.0, but does for version 1.0.
Not all fields are available through the API. You can see exactly what fields are available using the references I've provided above.
Looks like a Facebook Graph API bug.

How to send email in Microsoft Azure using SendGrid [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
In Microsoft Azure website, how can we send email using SendGrid?
You need to get SendGrid UserId & Key from Azure, and then use below code to send email:
public void SendEmail(string emailTo, string emailSubject, string emailBody)
{
try
{
//Create the email object first, then add the properties.
SendGrid myMessage = SendGrid.GetInstance();
myMessage.AddTo(emailTo);
myMessage.From = new MailAddress("abc#xyz.com", "Abc Xyz");
myMessage.Subject = emailSubject;
myMessage.Text = emailBody;
// Create credentials, specifying your user name and password. (Use SendGrid UserId & Password
var credentials = new NetworkCredential("azure_xxxxxxxxxxxxxxx#azure.com", "xxxxxxxxxxxx");
// Create an Web transport for sending email.
var transportWeb = Web.GetInstance(credentials);
//Send the email.
transportWeb.DeliverAsync(myMessage);
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
More more info you can refer following link http://sendgrid.com/docs/Code_Examples/csharp.html

Need help using Net::SSH::Expect module to provide password / yes/ no interaction [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Ok what i am looking for here is to do the following.
Login in to the remote server.
Execute a few cmds.
Interaction such as yes/no to generate keys.
CPAN Documentation is a Good Resource
As I discussed with you earlier in perl chat, this module is well documented on CPAN. Using some of the examples from there...
To configure Net::SSH::Expect for your server:
my $ssh = Net::SSH::Expect->new (
host => "myserver.com",
password=> 'pass87word',
user => 'bnegrao',
raw_pty => 1
);
To log in using password:
my $login_output = $ssh->login();
if ($login_output !~ /Welcome/) {
die "Login has failed. Login output was $login_output";
}
To run commands:
my $ls = $ssh->exec("ls -l /");
print($ls);
my $who = $ssh->exec("who");
print ($who);
To close connection:
$ssh->close();
You should really ask if you have more specific questions, as just asking for examples isn't really going to help you in accomplishing your task. The documentation is also very complete, so you should check there.

Twitter4J - 401:Authentication credentials were missing or incorrect [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I'm playing around with the Twitter4J API and am getting the 401:Authentication credentials were missing or incorrect when using the createFriendship method.
I obtain an instance of Twitter as follows:
protected Twitter getApi(String consumerKey, String consumerSecret, String accessToken, String secret) {
AccessToken token = new AccessToken(accessToken, secret);
return new TwitterFactory().getOAuthAuthorizedInstance(consumerKey, consumerSecret, token);
}
Once obtained I can successfully use the updateStatus method to tweet something. However when I try to execute the createFriendship method I get the following error even though the status updates are working fine
Request processing failed; nested
exception is 401:Authentication
credentials were missing or incorrect.
{"request":"\/1\/friendships\/create.json?screen_name=[user]","error":"Incorrect
signature"}
TwitterException{exceptionCode=[564a75a9-01c7e75c],
statusCode=401, retryAfter=0,
rateLimitStatus=null, version=2.1.5}
In the above error the screen_name=[user] the [user] section is replaced with the correct Twitter screen name.
Is there something I am missing?
Thank you
Sorry it was a simple problem with 2 different versions of Twitter4J on the classpath!