Fix the bug reported by fastlorenzo

main
Florent Daigniere 2 years ago
parent ae3f656923
commit f125420400

@ -62,7 +62,6 @@ def logout():
response.set_cookie(cookie, 'empty', expires=0) response.set_cookie(cookie, 'empty', expires=0)
return response return response
@sso.route('/proxy', methods=['GET']) @sso.route('/proxy', methods=['GET'])
@sso.route('/proxy/<target>', methods=['GET']) @sso.route('/proxy/<target>', methods=['GET'])
def proxy(target='webmail'): def proxy(target='webmail'):
@ -95,6 +94,8 @@ def proxy(target='webmail'):
return flask.abort(500, 'Too many users in (domain=%s)' % domain) return flask.abort(500, 'Too many users in (domain=%s)' % domain)
user = models.User(localpart=localpart, domain=domain) user = models.User(localpart=localpart, domain=domain)
user.set_password(secrets.token_urlsafe()) user.set_password(secrets.token_urlsafe())
flask.session.regenerate()
flask_login.login_user(user)
models.db.session.add(user) models.db.session.add(user)
models.db.session.commit() models.db.session.commit()
user.send_welcome() user.send_welcome()

Loading…
Cancel
Save