Implement Password Reset #12
2 changed files with 36 additions and 0 deletions
|
@ -50,3 +50,8 @@ def user_loader(user_id):
|
|||
def unauth():
|
||||
flash("Please login first")
|
||||
return redirect(url_for("registration.register"))
|
||||
|
||||
|
||||
class PwResetRequest(db.Model):
|
||||
id = Column(String, primary_key=True)
|
||||
user_id = db.relationship("User")
|
||||
|
|
31
migrations/versions/db38c3deb0b9_.py
Normal file
31
migrations/versions/db38c3deb0b9_.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: db38c3deb0b9
|
||||
Revises: a14a95ec57b0
|
||||
Create Date: 2022-12-30 14:35:27.652423
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'db38c3deb0b9'
|
||||
down_revision = 'a14a95ec57b0'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('pw_reset_request',
|
||||
sa.Column('id', sa.String(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('pw_reset_request')
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Reference in a new issue