mirror of
https://github.com/wassname/talk.git
synced 2026-08-05 13:30:26 +08:00
[next] Admin Authentication (#2155)
* feat: Support sign in via E-Mail, and social logins + permission check * feat: no permission info * test: unit test * test: fix remaining tests * test: add integration tests * feat: add admin account completion * test: auth completion feature tests * fix: translation * fix: comment marker design * fix: linting issues * chore: address pr review comments * chore: add comment
This commit is contained in:
@@ -49,7 +49,7 @@ const auth: DirectiveResolverFn<
|
||||
const conditions = calculateAuthConditionsMemoized(user);
|
||||
if (!permit && conditions.length > 0) {
|
||||
// TODO: return better error.
|
||||
throw new Error("not authorized");
|
||||
throw new Error("not authorized 1");
|
||||
}
|
||||
|
||||
// If the permit was specified, and some of the conditions for the user
|
||||
@@ -59,7 +59,7 @@ const auth: DirectiveResolverFn<
|
||||
conditions.some(condition => permit.indexOf(condition) === -1)
|
||||
) {
|
||||
// TODO: return better error.
|
||||
throw new Error("not authorized");
|
||||
throw new Error("not authorized 2");
|
||||
}
|
||||
|
||||
// If the role and user owner checks are disabled, then allow them based on
|
||||
|
||||
Reference in New Issue
Block a user