mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 07:12:20 -05:00
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
23 lines
558 B
Python
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')
|