srctree

Gregory Mullen parent 446985fc 042dc827
lower the error range for requireValid

src/auth.zig added: 4, removed: 2, total 2
@@ -19,7 +19,9 @@ pub fn valid(a: Auth) bool {
return a.provider.valid() catch false;
}
 
pub fn requireValid(a: Auth) Error!void {
/// Unauthenticated is the only error this is able to return as the correct
/// definition for an HTTP 401
pub fn requireValid(a: Auth) error{Unauthenticated}!void {
if (a.current_user == null or !a.valid()) return error.Unauthenticated;
}