本文整理汇总了Python中tracim_backend.lib.core.user.UserApi.set_password_reset_token方法的典型用法代码示例。如果您正苦于以下问题:Python UserApi.set_password_reset_token方法的具体用法?Python UserApi.set_password_reset_token怎么用?Python UserApi.set_password_reset_token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tracim_backend.lib.core.user.UserApi
的用法示例。
在下文中一共展示了UserApi.set_password_reset_token方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reset_password_modify
# 需要导入模块: from tracim_backend.lib.core.user import UserApi [as 别名]
# 或者: from tracim_backend.lib.core.user.UserApi import set_password_reset_token [as 别名]
def reset_password_modify(self, context, request: TracimRequest, hapic_data=None): # nopep8
"""
Do change the password. This requires the token received by email.
After this request returns a 200, the user password is effectively changed
"""
app_config = request.registry.settings['CFG']
uapi = UserApi(
None,
session=request.dbsession,
config=app_config,
)
user = uapi.get_one_by_email(hapic_data.body.email)
uapi.set_password_reset_token(
new_password=hapic_data.body.new_password,
new_password2=hapic_data.body.new_password2,
reset_token=hapic_data.body.reset_password_token,
user=user,
do_save=True
)
return