Skip to content

Commit 9447097

Browse files
committed
fixed
1 parent 1a88572 commit 9447097

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = .zig_jwt,
33
.description = "A JWT (JSON Web Token) library for zig.",
4-
.version = "1.2.10",
4+
.version = "1.2.11",
55
.fingerprint = 0x30a5aec248bd7ac3,
66
.minimum_zig_version = "0.15.0-dev.337+4e700fdf8",
77
.dependencies = .{},

src/token.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ pub const Token = struct {
9999
}
100100

101101
pub fn parse(self: *Self, token_string: []const u8) void {
102-
if (token_string.len == 0) {
103-
return;
104-
}
105-
106102
self.raw = self.alloc.dupe(u8, token_string) catch "";
107103
self.header = "";
108104
self.claims = "";
109105
self.signature = "";
110106

107+
if (token_string.len == 0) {
108+
return;
109+
}
110+
111111
var it = std.mem.splitScalar(u8, token_string, '.');
112112
if (it.next()) |pair| {
113113
self.header = utils.base64UrlDecode(self.alloc, pair) catch "";

0 commit comments

Comments
 (0)