File tree 5 files changed +21
-1
lines changed
5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1714,6 +1714,10 @@ ui:
1714
1714
title : Private
1715
1715
label : Login required
1716
1716
text : Only logged in users can access this community.
1717
+ password_login :
1718
+ title : Password login
1719
+ label : Allow email and password login
1720
+ text : " WARNING: If turn off, you may be unable to log in if you have not previously configured other login method."
1717
1721
installed_plugins :
1718
1722
title : Installed Plugins
1719
1723
plugin_link : Plugins extend and expand the functionality of Answer. You may find plugins in the <1>Answer Plugin Repository</1>.
Original file line number Diff line number Diff line change @@ -454,6 +454,7 @@ export interface AdminSettingsLogin {
454
454
login_required : boolean ;
455
455
allow_email_registrations : boolean ;
456
456
allow_email_domains : string [ ] ;
457
+ allow_password_login : boolean ;
457
458
}
458
459
459
460
/**
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ const Index: FC = () => {
47
47
description : t ( 'email_registration.text' ) ,
48
48
default : true ,
49
49
} ,
50
+ allow_password_login : {
51
+ type : 'boolean' ,
52
+ title : t ( 'password_login.title' ) ,
53
+ description : t ( 'password_login.text' ) ,
54
+ default : true ,
55
+ } ,
50
56
allow_email_domains : {
51
57
type : 'string' ,
52
58
title : t ( 'allowed_email_domains.title' ) ,
@@ -73,6 +79,12 @@ const Index: FC = () => {
73
79
label : t ( 'email_registration.label' ) ,
74
80
} ,
75
81
} ,
82
+ allow_password_login : {
83
+ 'ui:widget' : 'switch' ,
84
+ 'ui:options' : {
85
+ label : t ( 'password_login.label' ) ,
86
+ } ,
87
+ } ,
76
88
allow_email_domains : {
77
89
'ui:widget' : 'textarea' ,
78
90
} ,
@@ -105,6 +117,7 @@ const Index: FC = () => {
105
117
allow_email_registrations : formData . allow_email_registrations . value ,
106
118
allow_email_domains : allowedEmailDomains ,
107
119
login_required : formData . login_required . value ,
120
+ allow_password_login : formData . allow_password_login . value ,
108
121
} ;
109
122
110
123
putLoginSetting ( reqParams )
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ const Index: React.FC = () => {
45
45
ucAgentInfo = ucAgent . agent_info ;
46
46
}
47
47
const canOriginalLogin =
48
- ! ucAgentInfo || ucAgentInfo . enabled_original_user_system ;
48
+ ( ! ucAgentInfo || ucAgentInfo . enabled_original_user_system ) &&
49
+ loginSetting . allow_password_login ;
49
50
50
51
const [ formData , setFormData ] = useState < FormDataType > ( {
51
52
e_mail : {
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const loginSetting = create<IType>((set) => ({
32
32
login_required : false ,
33
33
allow_email_registrations : true ,
34
34
allow_email_domains : [ ] ,
35
+ allow_password_login : true ,
35
36
} ,
36
37
update : ( params ) =>
37
38
set ( ( ) => {
You can’t perform that action at this time.
0 commit comments