File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ def login(login_message: Optional[str] = None):
116
116
117
117
118
118
@webapp .route ('/signup' , methods = ['GET' , 'POST' ])
119
+ @limiter .limit (f'{ LIMITS_PER_MINUTE } /minute;{ LIMITS_PER_HOUR } /hour' )
119
120
def signup ():
120
121
if not webapp .config .get ('REGISTRATION_OPEN' , False ):
121
122
return redirect (url_for (
@@ -141,13 +142,14 @@ def signup():
141
142
142
143
143
144
@webapp .route ('/confirm-email/<int:user_id>/<token>' )
145
+ @limiter .limit (f'{ LIMITS_PER_MINUTE } /minute;{ LIMITS_PER_HOUR } /hour' )
144
146
def confirm_email (user_id : int , token : str ):
145
147
user = User .get_or_none (User .id == user_id )
146
148
if user is None :
147
- return fail (404 , f'No such user with id { user_id } .' )
149
+ return fail (404 , f'The authentication code is invalid .' )
148
150
149
151
if not user .role .is_unverified :
150
- return fail (403 , f'User has been already confirmed { user . username } ' )
152
+ return fail (403 , f'User has been already confirmed. ' )
151
153
152
154
try :
153
155
SERIALIZER .loads (
@@ -162,7 +164,7 @@ def confirm_email(user_id: int, token: str):
162
164
),
163
165
))
164
166
except BadSignature :
165
- return fail (404 , 'No such signature ' )
167
+ return fail (404 , 'The authentication code is invalid. ' )
166
168
167
169
else :
168
170
update = User .update (
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ <h1 id="main-title" class="h3 font-weight-normal">{{ _('התחברות') }}</h1>
35
35
< button class ="btn btn-primary btn-lg btn-block "> {{ _('התחבר') }}</ button >
36
36
</ form >
37
37
{% if config.REGISTRATION_OPEN %}
38
- < hr class ="mt-3 mb-3 "/ >
38
+ < hr class ="mt-3 mb-3 ">
39
39
< a href ="/signup " class ="btn btn-success btn-sm " role ="button "> {{ _('הירשם') }}</ a >
40
40
{% endif %}
41
41
</ div >
You can’t perform that action at this time.
0 commit comments