Youtube data api token - api

I'm going through this tutorial: https://developers.google.com/youtube/v3/quickstart/php and I have come to a problem at step 4. I have ran the quickstart.php and got the link to the code, but I accidentally pressed "enter" without typing in the code. Now if I run it again I get an error:
PHP Fatal Error: Uncaught LogicException: refresh token must be passed in or set as part of setAccessToken.
I understand i can't make another token, i just would like to know how do I delete this token and make a new one.

Found the solution. I had to delete php-yt-oauth2.json file in home directory, which was declared here: define('CREDENTIALS_PATH', '~/php-yt-oauth2.json');.

Related

Vue: Showing that the function does not exist when I have defined it the relevant store

I am currently working on a simple app to store workout routines in Nuxt 3 and Appwrite. The link to the source code is here.
After logging in and adding in some workouts in the app's UI, whenever I try to call the deleteWorkout function, I get an error in the console saying that the function is not defined, whereas I have clearly defined in the workoutStore. I can't seem to figure out the reason for the same.
The same can be seen in the given screenshot.
Console on clicking the delete button
PS:
Most probably the error should be originating from either /pages/workouts.vue, /components/WorkoutDetails.vue or /stores/workout.js.
I am using Appwrite to manage the back-end of the web app, and the instructions to setup the same can be found in the README.md. (Though I don't think the error I am facing is related to the same.)
In your code the problem is, you declear your deleteWorkout() function outside of the actions block in workout.js file.
Make sure all your functions in the workout store are inside the actions block. Then it will be accessable from the vue component

can't save changes when deleting Routing App Coverage File

I'm trying to remove the Routing App Coverage .geojson file. Every-time I try to remove this and save changes, I get this error:
We’re temporarily unable to save your changes. Please try again
later.
It's been 2 days now. I still can't remove it. If I try to change any other field in the app submission form, it works. Just not the Routing file.
Here is what happened that led to this point:
I tried to submit an app with a valid .geojson file
I got an Invalid Binary error and the app was not submitted. This is because my app does not support routing.
I try to remove the Routing .geojson file from my submission form.
It doesn't work. I keep getting the error " We’re temporarily unable to save your changes. Please try again later. "
Error keeps occurring after 2 days.
I have no idea what is wrong. Please help. Thanks
I do not know if you have solved this, but I had the same problem. Just inspect the element (that pop-up that appears on top of the Routing App coverage), delete the element from browser's tree and press the delete button.

Persistent React-Native error that goes away with Remote Debugging enabled

I'm building a React-Native app and whenever I run it on my Android emulator, I get this error:
Objects are not valid as a React child (found: object with keys
{$$typeof, type, key, ref, props, _owner, _store}). If you meant to
render a collection of children, use an array instead.
throwOnInvalidObjectType
D:\rn\manager\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:7436:6
Because this error means nothing to me, I decide to enable "Debug JS Remotely" in Chrome to see if I can get an error I understand. But with Debug Remotely enabled, the error goes away.
If I build the project and install the app on a real device, the errors come back.
But I feel like I'm stuck in a catch-22 because if I try to debug, I get no errors, and if I turn off debugging, I get errors.
Is there anyway to get around this?
Thanks!
The error mentions you use an object in your render() method where you shouldn't. Since you did not post any code, here is what you could do:
Keep removing elements from your render() method until you no longer get the error. Once it is gone, start placing code back until you hit the error again. The code causing the error will be or return an object, possibly a typo causing an object to be returned instead of a string for instance.
TL;DR: Stopped using firebase and used react-native-firebase instead
The problem for me wasn't the render method in any of my components or classes. I realized after trying the answer above, I basically removed all my files, and was left with one file. I changed the render method to display text inside one view, but I still got the error.
Then I started removing the modules I was importing inside that file one by one and found that it was the firebase module uninstalled firebase and installed react-native-firebase.

Auth0 and Vue: Error in render function: "InvalidTokenError: Invalid token specified: Cannot read property 'replace' of undefined"

guys, I'm going through the VueJS tutorial for Auth0, and am getting this error:
InvalidTokenError {message: "Invalid token specified: Cannot read property 'replace' of undefined"}
message:"Invalid token specified: Cannot read property 'replace' of undefined"
The tutorial is here:
https://auth0.com/blog/vuejs2-authentication-tutorial/
The error is happening right when the app is supposed to bring up the Auth0 Lock widget.
Thoughts?
Clear your browser's local storage cache.
e.g
for Chrome, press F12 to go to developer window, Storage\Local Storage, right click and clear.
For IE, F12 to developer window. On 'Console' tab, run the command
localStorage.clear()
Sorry I cannot comment on your question because my rank is too low. I had the same error coming up when I followed the react version of you tutorial.
The issue in my case was due to the fact that in the auth.js file, there is a function called getTokenExpirationDate(encodedToken). Inside that function the line const token = decode(encodedToken); was the cause of the bug.
By investigating the value of encodedToken I found out that it's value was a string with the characters 'none', (not the value none itself!). This makes the encode function very unhappy.
If you go in the chrome developer tools, click on the Application tab, open the Local Storage option on the left hand side and select you site. You will be able to see all the key-value pairs stored in your local storage for your app. In my case the key id_token had the value none. If it's the case for you too, just delete that key/value pair from the local storage and the page should be able to load again.
Hope this helped and good luck!
Edit
By playing with local storage with chrome developer tools I realised the local storage can be a bit buggy. Sometimes I try to view the local storage but it doesn't appear. When that happens just try closing and reopening the tool.
I also was running into this issue. I had one rule called 'auth0-authorization-extension' activated that triggered this error.
This fixed it for me. It is in typescript. You can remove (token: string) to (token) if not using TS
function parseJwt (token: string) {
var base64Url = token.split('.')[0];
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
return JSON.parse(jsonPayload);
};
if you have token in another place, you can copy token in cookies.
you can find your token in Insomia software.
you can copy it
come back to browser and open inspect with F12
open cockies and paste token there

Logging Current Directory/Filename in React Native

I was wondering if there is a way to log the current filename or directory in React Native. Similar to how NodeJS does it with __filename and __dirname.
No, it's not possible since all the source code gets bundled together into one big file, and then a source map is provided so that you can debug it in the original structure.
You can see that by calling this code snippet somewhere in your code:
console.log(new Error().stack);
In a regular javascript you would get the entire trace with files and line numbers, but in react-native you get somthing like:
Error
at Login (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:83009:9)
at instantiate (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:5712:18)
at new Login (eval at proxyClass (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:5730:16), <anonymous>:4:17)
at ReactCompositeComponentWrapper._constructComponentWithoutOwner (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22051:19)
at ReactCompositeComponentWrapper._constructComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22033:13)
at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:21952:15)
at Object.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:20425:29)
at ReactCompositeComponentWrapper.performInitialMount (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22134:28)
at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22015:13)
at Object.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:20425:29)"
which shows you the real files are gone.