forked from alemi/upub
fix: session id is session
This commit is contained in:
parent
fbd175e8f3
commit
41899556bf
2 changed files with 3 additions and 7 deletions
|
@ -28,13 +28,11 @@ impl MigrationTrait for Migration {
|
||||||
.table(Sessions::Table)
|
.table(Sessions::Table)
|
||||||
.col(
|
.col(
|
||||||
ColumnDef::new(Sessions::Id)
|
ColumnDef::new(Sessions::Id)
|
||||||
.integer()
|
.string()
|
||||||
.not_null()
|
.not_null()
|
||||||
.auto_increment()
|
|
||||||
.primary_key()
|
.primary_key()
|
||||||
)
|
)
|
||||||
.col(ColumnDef::new(Sessions::Actor).string().not_null())
|
.col(ColumnDef::new(Sessions::Actor).string().not_null())
|
||||||
.col(ColumnDef::new(Sessions::Session).string().not_null())
|
|
||||||
.col(ColumnDef::new(Sessions::Expires).date_time().not_null())
|
.col(ColumnDef::new(Sessions::Expires).date_time().not_null())
|
||||||
.to_owned()
|
.to_owned()
|
||||||
)
|
)
|
||||||
|
@ -63,8 +61,7 @@ enum Credentials {
|
||||||
#[derive(DeriveIden)]
|
#[derive(DeriveIden)]
|
||||||
enum Sessions {
|
enum Sessions {
|
||||||
Table,
|
Table,
|
||||||
Id, // TODO here ID is a number but in Credentials it's the actor ID (String) ??? weird!!
|
Id, // TODO here ID is the session "secret" but in Credentials it's the actor ID (String) ??? weird!!
|
||||||
Actor,
|
Actor,
|
||||||
Session,
|
|
||||||
Expires,
|
Expires,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,8 @@ use sea_orm::entity::prelude::*;
|
||||||
#[sea_orm(table_name = "sessions")]
|
#[sea_orm(table_name = "sessions")]
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
#[sea_orm(primary_key)]
|
#[sea_orm(primary_key)]
|
||||||
pub id: i64,
|
pub id: String,
|
||||||
pub actor: String,
|
pub actor: String,
|
||||||
pub session: String,
|
|
||||||
pub expires: ChronoDateTimeUtc,
|
pub expires: ChronoDateTimeUtc,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue