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

Customize login modal #20

Open
leog opened this issue Oct 29, 2016 · 4 comments
Open

Customize login modal #20

leog opened this issue Oct 29, 2016 · 4 comments

Comments

@leog
Copy link

leog commented Oct 29, 2016

Hello!

This is a great plugin, I'm hoping to use it on our Discourse instance for our political party on Uruguay based on IT.

I was wondering if there is any way to customize the lock instance to match our desired look and feel used on our main entry page at https://acceso.partidodigital.org.uy. There we are using the following code:

// Auth0Lock options
var options = {
    container: "lock",
    language: "es",
    theme: {
        logo: "assets/img/logo_text.svg",
        primaryColor: "#F37021"
    },
    allowForgotPassword: true,
    allowLogin: true,
    loginAfterSignUp: false,
    mustAcceptTerms: true,
    languageDictionary: {
        signUpTerms: "Acepto los <a href='/terms' target='_new'>términos de uso</a> y <a href='/privacy' target='_new'>privacidad</a>.",
        title: "Acceso",
        success: {
            signUp: "Registro completado exitosamente. Chequea tu correo para verificar tu dirección y seguir con los próximos pasos."
        }
    },
    additionalSignUpFields: [{
        name: "credencial",
        placeholder: "ingrese su credencial",
        icon: "assets/img/credencial.png",
        validator: function(credencial) {
            function isNumber(n) {
                return !isNaN(parseFloat(n)) && isFinite(n)
            }
            var split = credencial.split(" ");
            return {
                valid: split.length === 2 && !isNumber(split[0]) && isNumber(split[1]),
                hint: "Aseguresé de ingresar su credencial en formato \"ABC 12345\" con un espacio."
            };
        }
    }]
};

Seems like the code used on Discourse comes from a js file corresponding to the client app setup on Auth0 dashboard, but I couldn't see any place to customize the lock options.

Any help would be greatly appreciated.

Regards.

@jfromaniello
Copy link
Member

You can fork this repo, make the changes to the js file (hardcoding your dict) and then follow the install instructions but instead of using this url you use your own.

@leog
Copy link
Author

leog commented Oct 29, 2016

That's certainly a very good idea. Thanks @jfromaniello, I'm closing this one.

@leog leog closed this as completed Oct 29, 2016
@leog
Copy link
Author

leog commented Oct 31, 2016

@jfromaniello I was wondering if you could help me figure out how to enable SSO on Discourse using this plugin. I already forked this project to customize the experience here: https://github.com/PartidoDigital/Discourse-App-Auth0-Plugin/blob/master/assets/javascripts/auth0.js

Just to give some extra info: we need to have a central point to login and that's on https://acceso.partidodigital.org.uy based on this code: https://github.com/PartidoDigital/PartidoDigital-Web-Acceso/blob/master/index.html. When the user signs in there, they should redirect to Discourse at https://debate.partidodigital.org.uy and be already logged in. And if the user logs in from Discourse itself, going to the central point web should redirect the user to Discourse automatically.

Any ideas?

@leog leog reopened this Oct 31, 2016
@leog
Copy link
Author

leog commented Oct 31, 2016

@jfromaniello should I post this question on auth0 forums or open a support ticket?
Please let me know ASAP as I'm blocked by this.
Thanks.

UPDATE: I ended up creating a new topic on Auth0 forum here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants