authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-08-16 21:35:21 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-08-16 21:35:21 -07:00
logcf510ecdf568d4f88e75df8a71bdc584b11f980b
treeff53008ac09580cb19d9a1f3e59f37ed6e4fe2af
parent459971f791c8e5b0a1d7b4815d9a3a9389044693

update to Zig 0.11


2 files changed, 6 insertions(+), 5 deletions(-)

.gitignore+1
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1zig-*1zig-*
2.zigmod2.zigmod
3deps.zig3deps.zig
4files.zig
src/lib.zig+5-5
...@@ -277,10 +277,10 @@ pub fn Handlers(comptime T: type) type {...@@ -277,10 +277,10 @@ pub fn Handlers(comptime T: type) type {
277 if (req.status != .ok) return error.OauthBadToken;277 if (req.status != .ok) return error.OauthBadToken;
278 const val = try extras.parse_json(alloc, body_content);278 const val = try extras.parse_json(alloc, body_content);
279279
280 const tt = val.root.object.get("token_type").?.string;280 const tt = val.value.object.get("token_type").?.string;
281 if (!std.mem.eql(u8, tt, "bearer")) return fail(response, body_writer, "oauth2: invalid token type: {s}", .{tt});281 if (!std.mem.eql(u8, tt, "bearer")) return fail(response, body_writer, "oauth2: invalid token type: {s}", .{tt});
282282
283 const at = val.root.object.get("access_token") orelse return try fail(response, body_writer, "Identity Provider Login Error!\n{s}", .{body_content});283 const at = val.value.object.get("access_token") orelse return try fail(response, body_writer, "Identity Provider Login Error!\n{s}", .{body_content});
284284
285 const req2 = try zfetch.Request.init(alloc, client.provider.me_url, null);285 const req2 = try zfetch.Request.init(alloc, client.provider.me_url, null);
286 var headers2 = zfetch.Headers.init(alloc);286 var headers2 = zfetch.Headers.init(alloc);
...@@ -294,9 +294,9 @@ pub fn Handlers(comptime T: type) type {...@@ -294,9 +294,9 @@ pub fn Handlers(comptime T: type) type {
294 if (req2.status != .ok) return error.OauthBadUserinfo;294 if (req2.status != .ok) return error.OauthBadUserinfo;
295 const val2 = try extras.parse_json(alloc, body_content2);295 const val2 = try extras.parse_json(alloc, body_content2);
296296
297 const id = try fixId(alloc, val2.root.object.get(client.provider.id_prop).?);297 const id = try fixId(alloc, val2.value.object.get(client.provider.id_prop).?);
298 const name = val2.root.object.get(client.provider.name_prop).?.string;298 const name = val2.value.object.get(client.provider.name_prop).?.string;
299 try T.saveInfo(response, alloc, client.provider, id, name, val.root, val2.root);299 try T.saveInfo(response, alloc, client.provider, id, name, val.value, val2.value);
300300
301 try response.headers.append("Location", T.doneUrl);301 try response.headers.append("Location", T.doneUrl);
302 response.status = .found;302 response.status = .found;