srctree

Gregory Mullen parent aaf47a1b dad4de59
expand invalid auth helper

src/auth.zig added: 15, removed: 4, total 11
@@ -22,15 +22,26 @@ pub const InvalidAuth = struct {
return Provider{
.ctx = undefined,
.vtable = .{
.authenticate = null, // TODO write invalid
.authenticate = authenticate,
.valid = valid,
.lookup_user = lookupUser,
.create_session = null,
.get_cookie = null,
.create_session = createSession,
.get_cookie = getCookie,
},
};
}
 
fn authenticate(_: *const anyopaque, _: *const Headers) Error!User {
return error.UnknownUser;
}
 
fn createSession(_: *const anyopaque, _: *const User) Error!void {
return error.Unauthenticated;
}
fn getCookie(_: *const anyopaque, _: User) Error!?RequestCookie {
return error.Unauthenticated;
}
 
fn valid(_: *const anyopaque, _: *const User) bool {
return false;
}