Skip to content

Commit

Permalink
✨ Add JwtHeaders::with_cty function
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed Jul 19, 2023
1 parent d8a8319 commit b0b008f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jumpdrive-auth"
version = "2.0.0"
version = "2.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ I currently have no intentions to publish this to crates.io, so for now if you w
dependency using:

```toml
jumpdrive-auth = { git = "https://github.com/Jumpdrive-dev/Auth-Services", tag = "2.0.0" }
jumpdrive-auth = { git = "https://github.com/Jumpdrive-dev/Auth-Services", tag = "2.1.0" }
```

## Features
Expand Down
9 changes: 9 additions & 0 deletions src/models/jwt/jwt_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ pub struct JwtHeader<T = JwtTokenType> {
pub cty: Option<T>,
}

impl<T> JwtHeader<T> {
pub fn with_cty(value: T) -> JwtHeader<T> {
JwtHeader {
cty: Some(value),
..JwtHeader::default()
}
}
}

impl<T> Default for JwtHeader<T> {
fn default() -> JwtHeader<T> {
Self {
Expand Down

0 comments on commit b0b008f

Please sign in to comment.