2020-12-24 16:24:04 +01:00
|
|
|
use {
|
2020-12-24 16:24:47 +01:00
|
|
|
crate::{db_find, tokens::FindAccessToken},
|
|
|
|
diesel::prelude::*,
|
|
|
|
jirs_data::User,
|
2020-12-24 16:24:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
db_find! {
|
|
|
|
AuthorizeUser,
|
|
|
|
msg => conn => users => {
|
|
|
|
let token = FindAccessToken {
|
|
|
|
token: msg.access_token,
|
|
|
|
}
|
|
|
|
.execute(conn)?;
|
|
|
|
users.find(token.user_id)
|
|
|
|
},
|
|
|
|
User,
|
|
|
|
access_token => uuid::Uuid
|
|
|
|
}
|