Customize devise_jwt errors - jwt

I am using devise and devise_jwt for token authentication. So when the token is expired it gives me an error
{"errors": "Signature has expired"}
but I want to customize this error to
{"errors": "Need to login again"}
Is this possible to customize the error?
Thanks in advance

Related

'Validating the security token of this form has failed. Please reload the form and submit it again.'

I uploaded a picture and then tried to delete it, and I got this message:
Validating the security token of this form has failed. Please reload the form and submit it again.
What can I do to delete the picture and not get this error message?
Looks to me like the security token just expired (session time over?) - try clearing cache and reloading or even better relogin to the backend as Simon Gilli already mentioned it.

Configure TYPO3 Crawler Extension

I followed this tutorial to index some files in the fileadmin. Now I am at the point "Then manually process the entry: (...)". The problem is that I get this errormessage when I click on the green "refresh-Button":
Can someone tell me what am I doing wrong and why I am not authorized to Crawl through my page as the message: Error: 401 Authorization Required Authorization R... tells me.
By the way: i did not forget to add the user: _cli_crawler .
Thanks in advance
If you have use HTTP Authentication in your project then you can use baseUrl something like below. For more details clike here
http://user:pass#www.mydomain.com/
I think you add htpassword in your site that prevent pages to being indexed.
so remove first htaccess password protection and after try to reindex again.

Facebook authentication tutorial missing piece

For the past 2 days I've been struggling trying to successfully authenticate users into my Facebook app. What I want to achieve in the end is to retrieve and store the access token of an user.
The problem I have comes by following the FB tutorial for authentication: http://developers.facebook.com/docs/authentication/
Just above the Client-side Flow section there is a snippet of code which should allow me to get the current user. Unfortunately, I only get an error:
Warning: file_get_contents(https://graph.facebook.com/me?access_token=) [function.file-get-contents]: failed to open stream: No route to host
Traced the error back to the point I can, and apparently there is an error on this line:
$response = #file_get_contents($token_url);
because if I echo the $response, I get nothing.
What is there not mentioned in the tutorial that I should be doing but I'm not because I have no idea I should do it?
Many thanks
You can achieve getting the access Token by
// Get the current access token
$access_token = $facebook->getAccessToken();
//And now echo the access token
echo $access_token;
Well, it got sorted in the end. Apparently it's a server problem. I tried developing the app on 2 different servers + locally (EasyPhp 5.3.8.1). On the 3rd server I tried it works for now (fingers crossed). Honestly, I have no idea why it's working now and why my local server didn't function as it should have. Well, it works for now :D

How to obtain new facebook access token

I looked all over facebook api docs for FLEX and i couldn't find a way to obtain a new access token, can anyone please guide me how to that?
By the way , the only time I get error "access token" is when I try to get information from the api and using the parameter "since".
when I use this call, im getting a token error message
FacebookDesktop.api("me/likes?since=1319917311",handleFeed);
and when im using it without since
FacebookDesktop.api("me/likes",handleFeed);
I get no error message
anyway the main issue is how to obtain a new access token
10x!
You should use third argument of FacebookDesktop.api method to pass additional parameters:
FacebookDesktop.api("me/likes",handleFeed, {
since:1319917311
});

FB.api('/page_id/admins/') throws (#210) Subject is not a page

So I have a page, and am trying to create an app that determines whether or not a user is an admin of that page. The documentation states to use page_id/admins/user_id, which I am. However, it keeps throwing the error "Subject is not a page," which is obviously is, and even when I get just the page, it's type is set to "page." Why am I getting this error, and how would I fix it?
You should use the Page access token when making this call - see https://developers.facebook.com/docs/reference/api/page/#page_access_tokens
The "subject" in this case is the page so you should use that access token.