Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A0 widget #16

Merged
merged 55 commits into from
Oct 8, 2014
Merged

A0 widget #16

merged 55 commits into from
Oct 8, 2014

Conversation

glena
Copy link
Contributor

@glena glena commented Sep 26, 2014

Added the Auth0 login plugin.

There were already a shortcode to show the auth0 login form.
Here is a screenshot of both (the new widget and the shortcode) https://cloudup.com/c9Ze-siQEBg

Is there any way that two login form can be shown?
If I add the widget and the shortcode only shows one of them

@woloski
Copy link
Contributor

woloski commented Sep 26, 2014

we need to update to lock github.com/auth0/lock

On Thu, Sep 25, 2014 at 9:59 PM, Germán Lena [email protected]
wrote:

Added the Auth0 login plugin.
There were already a shortcode to show the auth0 login form.
Here is a screenshot of both (the new widget and the shortcode) https://cloudup.com/c9Ze-siQEBg
Is there any way that two login form can be shown?
If I add the widget and the shortcode only shows one of them
You can merge this Pull Request by running:
git pull https://github.com/auth0/wp-auth0 a0-widget
Or you can view, comment on it, or merge it online at:
#16
-- Commit Summary --

@glena
Copy link
Contributor Author

glena commented Sep 26, 2014

Just to double check:

Right now it is loading //cdn.auth0.com/w2/auth0-widget-5.min.js and it should be changed to //cdn.auth0.com/js/lock-6.min.js

and initialices the widget in this way:

var widget = new Auth0Widget({
        domain:     '<?php echo $domain; ?>',
        chrome: true,
        clientID:       '<?php echo $client_id; ?>',
        callbackURL:    '<?php echo site_url('/index.php?auth0=1'); ?>',
        container:      'auth0-login-form',
        state:          '<?php echo $state; ?>',
        showSignup:     <?php echo $allow_signup?'true':'false' ?>,
        dict:           { signin: { title: '<?php echo $title ?>' } }
    });

    widget.signin({
        onestep: true,
        theme: 'static',
        standalone: true,
        showIcon: <?php echo ($show_icon ? 'true' : 'false'); ?>,
        icon: '<?php echo ($show_icon ? WP_Auth0_Options::get('icon_url') : ''); ?>'
    }, callback);

It should be changed in this way:

The domain and clientID are the parameters when Auth0Lock is initialized.

Then to show the withget should I use showSignin or show depending if "allow signup" is enabled.

The options are:

  • callbackURL
  • container
  • authParams(state)
  • dict
  • icon (showIcon is no longer needed to send as a parameter)

What about this options?

  • chrome
  • onestep
  • theme
  • standalone

I'm missing something?

@woloski
Copy link
Contributor

woloski commented Sep 26, 2014

yep that's pretty much all. there is a migration guide in the wiki

On Thu, Sep 25, 2014 at 10:31 PM, Germán Lena [email protected]
wrote:

Just to double check:
Right now it is loading //cdn.auth0.com/w2/auth0-widget-5.min.js and it should be changed to //cdn.auth0.com/js/lock-6.min.js
and initialices the widget in this way:

var widget = new Auth0Widget({
        domain:     '<?php echo $domain; ?>',
        chrome: true,
        clientID:       '<?php echo $client_id; ?>',
        callbackURL:    '<?php echo site_url('/index.php?auth0=1'); ?>',
        container:      'auth0-login-form',
        state:          '<?php echo $state; ?>',
        showSignup:     <?php echo $allow_signup?'true':'false' ?>,
        dict:           { signin: { title: '<?php echo $title ?>' } }
    });
    widget.signin({
        onestep: true,
        theme: 'static',
        standalone: true,
        showIcon: <?php echo ($show_icon ? 'true' : 'false'); ?>,
        icon: '<?php echo ($show_icon ? WP_Auth0_Options::get('icon_url') : ''); ?>'
    }, callback);

It should be changed in this way:
The domain and clientID are the parameters when Auth0Lock is initialized.
Then to show the withget should I use showSignin or show depending if "allow signup" is enabled.
The options are:

  • callbackURL
  • container
  • authParams(state)
  • dict
  • icon (showIcon is no longer needed to send as a parameter)
    What about this options?
  • chrome
  • onestep
  • theme
  • standalone
    I'm missing something?

    Reply to this email directly or view it on GitHub:
    A0 widget #16 (comment)

@glena
Copy link
Contributor Author

glena commented Sep 26, 2014

ok, ready with lock.

should I update the readme with the widget, shortcode usage and the WP legacy login?

@woloski
Copy link
Contributor

woloski commented Sep 26, 2014

yes that would be great. also the short code should be parametrizable

On Fri, Sep 26, 2014 at 12:04 AM, Germán Lena [email protected]
wrote:

ok, ready with lock.

should I update the readme with the widget, shortcode usage and the WP legacy login?

Reply to this email directly or view it on GitHub:
#16 (comment)

@glena
Copy link
Contributor Author

glena commented Sep 26, 2014

Right now, both widget and shortcode is using the same settings as the login page.

Do you want to add a different configuration for each one?

(or I'm misunderstanding how it should be parametrizable)

@woloski
Copy link
Contributor

woloski commented Sep 26, 2014

Maybe someone wants to put the widget in a page with w different
parametrization (e.g. modal vs embedded). Like a way to override the
settings.

On Fri, Sep 26, 2014 at 11:02 AM, Germán Lena [email protected]
wrote:

Right now, both widget and shortcode is using the same settings as the
login page.

Do you want to add a different configuration for each one?

(or I'm misunderstanding how it should be parametrizable)


Reply to this email directly or view it on GitHub
#16 (comment).

@@ -345,6 +428,14 @@ private static function login_user( $userinfo, $data ){

public static function wp_init(){
self::setup_rewrites();

$cdn_url = WP_Auth0_Options::get('cdn_url');
if (strpos($cdn_url, 'auth0-widget-5') !== false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we be able to update Lock version as well in every future WP update if we want? Something like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to upgrade from auth0-widget-5 to lock. Right now, it is tied to lock-6.min.js and will be updated until the next major release.

If we want to force the update, I added an internal version counter (other than the AUTH0_DB_VERSION) to manage the settings updates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!


Martin Gontovnikas
Software Engineer
Buenos Aires, Argentina

Twitter: @mgonto (https://twitter.com/mgonto)
Linkedin: http:https://www.linkedin.com/in/mgonto
Github: https://github.com/mgonto

On Monday, 6 de October de 2014 at 11:49, Germán Lena wrote:

In WP_Auth0.php:

@@ -345,6 +428,14 @@ private static function login_user( $userinfo, $data ){ > > public static function wp_init(){ > self::setup_rewrites(); > + > + $cdn_url = WP_Auth0_Options::get('cdn_url'); > + if (strpos($cdn_url, 'auth0-widget-5') !== false)
this is to upgrade from auth0-widget-5 to lock. Right now, it is tied to lock-6.min.js and will be updated until the next major release.
If we want to force the update, I added an internal version counter (other than the AUTH0_DB_VERSION) to manage the settings updates.


Reply to this email directly or view it on GitHub (https://github.com/auth0/wp-auth0/pull/16/files#r18460630).

@mgonto
Copy link
Contributor

mgonto commented Oct 6, 2014

The rest looks good :).

@mgonto
Copy link
Contributor

mgonto commented Oct 6, 2014

Let me try this out before merging though

@mgonto
Copy link
Contributor

mgonto commented Oct 6, 2014

A few more changes:

  • Add a Settings link on the Plugin list item when it's listed like other plugins
  • The More Info link from the translations setting should open the link in a new window. Actually all of them should.
  • Remove the option Show Icon. From Lock if you set an icon, it's active by default. If you don't want to show it, just remove the icon.
  • Add a description to what Username Style, Enable on IP ranges and Remember Last Login option do. Link to the correct option in Lock Wiki
  • Explain in Extra settings the format of what you enter there. If it's JSon just link to an example or state that.
  • Remove Activate Auth0 option. If they don't want it, they can just disable the plugin
  • Default Big social buttons to false.

Thanks!

@glena glena merged commit 8d4e4cb into master Oct 8, 2014
@glena glena deleted the a0-widget branch October 8, 2014 00:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants