Files
notifications-api/migrations/versions/0065_users_current_session_id.py
Leo Hemsted a47672f7e3 Add current_session_id to the user model, update on login
when we change the last logged in time, set the current session id to
a random uuid

this way, we can compare it to the cookie a user has, and if they
differ then we can log them out

also update user.logged_in_at at 2FA rather than password check, since
that feels more accurate
2017-02-22 17:30:55 +00:00

23 lines
558 B
Python

"""empty message
Revision ID: 0065_users_current_session_id
Revises: 0064_update_template_process
Create Date: 2017-02-17 11:48:40.669235
"""
# revision identifiers, used by Alembic.
revision = '0065_users_current_session_id'
down_revision = '0064_update_template_process'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
op.add_column('users', sa.Column('current_session_id', postgresql.UUID(as_uuid=True), nullable=True))
def downgrade():
op.drop_column('users', 'current_session_id')