forked from ScoDoc/ScoDoc
JWT token size
This commit is contained in:
parent
8059e1622f
commit
8532ab5134
@ -65,7 +65,7 @@ class User(UserMixin, db.Model):
|
||||
date_created = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
date_expiration = db.Column(db.DateTime, default=None)
|
||||
passwd_temp = db.Column(db.Boolean, default=False)
|
||||
token = db.Column(db.String(32), index=True, unique=True)
|
||||
token = db.Column(db.Text(), index=True, unique=True)
|
||||
token_expiration = db.Column(db.DateTime)
|
||||
|
||||
roles = db.relationship("Role", secondary="user_role", viewonly=True)
|
||||
|
40
migrations/versions/91be8a06d423_user_token_size_limit.py
Normal file
40
migrations/versions/91be8a06d423_user_token_size_limit.py
Normal file
@ -0,0 +1,40 @@
|
||||
"""user token size limit
|
||||
|
||||
Revision ID: 91be8a06d423
|
||||
Revises: 4f98a8b02c89
|
||||
Create Date: 2021-12-20 22:48:42.390743
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "91be8a06d423"
|
||||
down_revision = "4f98a8b02c89"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column(
|
||||
"user",
|
||||
"token",
|
||||
existing_type=sa.VARCHAR(length=32),
|
||||
type_=sa.Text(),
|
||||
existing_nullable=True,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column(
|
||||
"user",
|
||||
"token",
|
||||
existing_type=sa.Text(),
|
||||
type_=sa.VARCHAR(length=32),
|
||||
existing_nullable=True,
|
||||
)
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue
Block a user