Drupal 8 Twitter doesnt appear for anonymous, only admin - twitter

What could be the problem when my twitter block only appears for admin and doesnt for anonymous users. I have set block permission for both anonymous and authenticated users.

What worked for me is i had to run the js library locally. This is my script:
Open you *****.libraries.yml and add :
global-scripts:
version: VERSION
js:
js/twitter/widgets.js: {}
dependencies:
- core/jquery
- core/drupal
Open your ****.info.yml and add under libraries:
libraries:
- ****/global-scripts

Related

How do I enable Auth0 logins in my Electron app now that Lock v10 is deprecated?

I have an Electron app that will talk to backend APIs secured to only accept Auth0 authorization tokens. Previously it was possible to use Auth0.js's Lock project, but Electron support ended at v10 and this was recently deprecated.
How else can I enable a login flow in my Electron app?
Try electron-auth0-login.
You can download the package from NPM:
# Installing electron-auth0-login
npm install electron-auth0-login --save
# Installing peer dependencies
npm install request request-promise-native --save
Initialising is simple. Just add the following to main process code:
import ElectronAuth0Login from 'electron-auth0-login';
const auth = new ElectronAuth0Login({
// Get these from your Auth0 application console
auth0Audience: 'https://api.mydomain.com',
auth0ClientId: 'abc123ghiMyApp',
auth0Domain: 'my-domain.eu.auth0.com',
auth0Scopes: 'given_name profile'
});
Have a redirect URL whitelisted for https://{your-auth0-domain}/mobile.
Now, when you want a token, call auth.getToken and electron-auth0-login will either return a token in memory (if valid), use a refresh token (if enabled) or kick off a new Auth0 login flow.
Full details can be found on the project’s readme: https://github.com/jbreckmckye/electron-auth0-login

Changing uploader for Flutter/Dart on same machine

I created package and uploaded via an account. i.e. uploader#outlook.com. I did not want to upload via this email address so I did:
pub uploader add new_uploader#outlook.com
Then I did
pub uploader remove uploader#outlook.com
The package displays correctly new_uploader#outlook.com now but I cannot figure out when I need to do a publish to use the new_uploader#outlook.com account. When I try:
flutter packages pub publish
It gives me this error:
UnauthorizedAccess: Unauthorized user: uploader#outlook.com is not allowed to upload versions to package flutter_platform_widgets.
pub finished with exit code 1
How do I tell flutter cli or the pub cli to use new_uploader#outlook.com and not uploader#outlook.com.
Both are google authorised accounts.
Also trying to do:
pub uploader add uploader#outlook.com
Gives an Unauthorized error.
Note: email addresses are not real, just for the purpose of the post
I did find the following as suggested by https://github.com/dart-lang/sdk/issues/14055
Delete the credential file:
.pub_cache/credentials.json
After doing this it asked for reauthentication which I used the new email address. I successfully uploaded the package with that email address.
Problem solved for me

HYbridauth for facebook login doesn't work

I was trying to configure the hybridauth library so that I can use the the google + and the facebook sign in. But it keeps me giving a fatal error:
Fatal error: require(): Failed opening required 'Facebook\Facebook.php' (include_path='.:/var/www/magilla/lib:/var/www/magilla/models') in /var/www/magilla/lib/RPC/Util.php on line 168
I followed each and every step of their documentation. I have used the
composer to install the library. The library version is 2.9 and the
facebook graph sdk, the most recent version of github
READ EDIT*2 for a proper solution instead
I am encountering the same issue and I suppose you install hybridauth the same way as I did, which is running composer require hybridauth/hybridauth on your project root folder.
I solved this by running composer install within the hybridauth
directory where its composer.json exist, that will install facebook
sdk within the hybridauth directory where the autoload.php is being
load by the script (I personally feel like it is more like a hack than
a proper solution... but I have a feeling that the hybridauth
developer expect you to clone then run the composer install instead of
composer requiring it...I maybe wrong as I just start using composer
as well)
*EDIT check out the issue on their github, there is a bug where the vendor path is being replaced by one in their code, it also mention it is being fixed in later commit. I am new to composer as well so I don't know how to specific the commit for it to update to... if you know how to do it let me know as well
*EDIT*2 alright, I updated to 2.9.3-dev and it seems to solve the issue without generating any new one, I also use that for google and twitter and those are fine too. To update, edit your composer.json to this
"require": {
"hybridauth/hybridauth": "^2.9-dev"
}
then run composer update on your command prompt, things should work as long as you require the composer autoload.php for your script

swagger-tools on node: How to load swaggerUi?

When I hit http://localhost:3001/api-docs loads the swagger json docs.
{
swagger: "2.0",
info: {
version: "1.0.0",
title: "Auth-gateway services",
contact: {
name: "swagger docs",
url: "https://www.google.com"
}
},
host: "127.0.0.1:3001",
basePath: "/",
...
}
But how do I load UI like http://petstore.swagger.io/ for my APIs.
To view you api through swagger-ui, do one of the following.
Option 1: Using online swagger-ui
Go to this.
On the dialog-box on the top of the page, provide the url for swagger-json. In your case, insert http://localhost:3001/api-docs instead of http://petstore.swagger.io/v2/swagger.json (which can be seen in default) and click Explore.
Now you can see swagger-ui generated for your api.
Option 2: Setting up swagger-ui project locally
You have to set up swagger-ui. You can clone the project set up that with the below instructions provided.
Windows Users: Please install Python before follow below guidelines
for node-gyp rebuild to run.
1. npm install
2. npm run build
3. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
Development
Use npm run serve to make a new build, watch for changes, and serve the result at http://localhost:8080/.
Now you should be able to see something exactly like online swagger-ui.
Do the same as option 1 to provide swagger-json url and see swagger-ui generated.

Deployd setting up email

Hi I have a deployd application that is working fine with its dashboard localhost:2403/dashboard
I want to utilise email with the app the deployd instructions state that I run npm install dpd-email
which creates a dpd-email directory in your app's node_modules directory.
To set up the emails ports etc
Before using the email resource, you must go to its Dashboard page and configure it.
Is this the apps dashboard as I can see no reference to email in localhost:2403/dashboard
or is there a seperate dashboard for dpd-email module ?
After installing the dpd-email module (npm install dpd-email), the dashboard should propose a new type a resource:
After adding this new resource, you can configure the module:
You can send emails by sending requests (see the readme of the module for more information)

Resources