Skip to content

Commit 9b81034

Browse files
dquach217sman591
authored andcommitted
feat: Hide MyMLH button if MLH_KEY env var is not set (#167)
* wrap the entire form with check of env var * display the form correctly
1 parent 07f5782 commit 9b81034

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

app/views/devise/registrations/_form.html.haml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
2-
.form-actions
3-
.center
4-
= render 'my_mlh_cta'
5-
%p
6-
%em or continue manually:
2+
- if ENV["MLH_KEY"].present?
3+
.form-actions
4+
.center
5+
= render 'my_mlh_cta'
6+
%p
7+
%em or continue manually:
78
.form-inputs
89
= f.input :email, required: true, autofocus: true
910
= f.input :password, required: true

app/views/devise/sessions/_form.html.haml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
2-
.form-actions
3-
.center
4-
= render 'my_mlh_cta'
5-
%p
6-
%em or use an email & password:
2+
- if ENV["MLH_KEY"].present?
3+
.form-actions
4+
.center
5+
= render 'my_mlh_cta'
6+
%p
7+
%em or use an email & password:
78
.form-inputs
89
= f.input :email, required: false, input_html: { autofocus: true }
910
= f.input :password, required: false

0 commit comments

Comments
 (0)