+use crate::settings::Settings;
use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation};
-use lemmy_db_schema::source::user::User_;
-use lemmy_utils::settings::Settings;
use serde::{Deserialize, Serialize};
type Jwt = String;
)
}
- pub fn jwt(user: User_, hostname: String) -> Result<Jwt, jsonwebtoken::errors::Error> {
+ pub fn jwt(user_id: i32, hostname: String) -> Result<Jwt, jsonwebtoken::errors::Error> {
let my_claims = Claims {
- id: user.id,
+ id: user_id,
iss: hostname,
};
encode(