更新 supabase 中的用户身份验证详细信息

问题描述 投票:0回答:0

我尝试使用烧瓶更新 supabase 中的用户身份验证详细信息。

supabase_client.auth.update_user({"id": email,"password": new_password })

这是我用来更新用户身份验证密码的。首先,我向用户请求密码,然后也在身份验证中更新用户表中的密码。

@app.route('/reset', methods=['GET','POST'])
   def reset():
       if request.method == 'POST':
           try:
            email=request.form['email']
            new_password = request.form['new_password']
            #update new password in the supabase in table name Users
            user=supabase_client.auth.get_user()
            supabase_client.auth.update_user({"id": email,"password": new_password })
            supabase_client.from_('Users').update({'password': new_password}).eq('email', email).execute()
            flash('password is updated')
            return render_template('login.html')

这是我用来重置密码的路线。但是我收到 API 错误

supabase_client.auth.update_user({"id": email,"password": new_password })

我只想知道我是否使用了正确的方法,如果有人知道如何使用烧瓶更新 supabase 中的用户身份验证详细信息。

python flask supabase-py
© www.soinside.com 2019 - 2024. All rights reserved.