We can use googleapis npm to implement google oauth2 functionality.Main thing is to create new one by refresh token when access token is expired. Get authorization code from client. Get refresh token from authorization code. Add following code to generate access token automatically when it is expired oauth2Client.on(‘tokens’, (tokens) => { if (tokens.refresh_token) { // store the refresh_token in my database! console.log(tokens.refresh_token); } console.log(tokens.access_token);});
Advanced Custom Fields for WordPress Developers
The basics Custom fields are a native part of WordPress and appear on pages, posts and custom post types, however, the native custom field interface is not very user friendly. With ACF installed, you can tailor what fields to show and what they look like. For instance, you may require a ‘Hero Image’ to be …
Arbitrary reference in Mongoose schema
Supposing you need parent reference of Task schema, and parent can be either manager or developer. You don’t have to define both reference IDs in Task schema. Instead MongoDB provides feature to define arbitrary reference. You can assign value as Manager schema ID or Developer schema ID.