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

edit login page #61

Open
krojowska opened this issue May 24, 2021 · 3 comments
Open

edit login page #61

krojowska opened this issue May 24, 2021 · 3 comments

Comments

@krojowska
Copy link

obraz
Where I can change and edit this page? I want to add regulations for users on this page.

Please help

@jonmbake
Copy link
Owner

@felagund
Copy link

felagund commented Nov 8, 2022

This is a duplicate of this: #28

But as far as I can tell, there is no straightforward way to add anything to this page ( I would like to add a link for users to reset their password).

@felagund
Copy link

felagund commented Nov 8, 2022

So, apparently one could customize it:

You can insert whatever html you want using the OmniAuth::Form#html method.

Here's where your LDAP strategy is building its form.

I'm not sure how you'd manage all the inner workings using jonmbake/discourse-ldap-auth, but using an omniauth strategy you'd

class Omniauth::Strategies::MyCustomLDAP < Omniauth::Strategies::LDAP
  def request_phase
    OmniAuth::LDAP::Adaptor.validate @options
    f = OmniAuth::Form.new(:title => (options[:title] || "LDAP Authentication"), :url => callback_path)
    f.text_field 'Login', 'username'
    f.password_field 'Password', 'password'
    f.button "Sign In"
    f.html '<a href="https://my-password-reset-url.com">Reset Password</a>'
    f.to_response
  end
end

However, I do not know ruby so I am not sure where to put anything :-(.

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

3 participants