Skip to content

Commit 6748714

Browse files
committed
Create user without APs during registration
1 parent 05f5654 commit 6748714

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/authentication/authentication.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import JWT from 'jsonwebtoken';
55
import { DateTime } from 'luxon';
66
import { Writable } from 'ts-essentials';
77
import { sessionFromContext } from '~/common/session';
8+
import { disableAccessPolicies, EdgeDB } from '~/core/edgedb';
89
import {
910
DuplicateException,
1011
GqlContextType,
@@ -38,6 +39,7 @@ export class AuthenticationService {
3839
private readonly privileges: Privileges,
3940
@Logger('authentication:service') private readonly logger: ILogger,
4041
private readonly repo: AuthenticationRepository,
42+
private readonly edgedb: EdgeDB,
4143
private readonly moduleRef: ModuleRef,
4244
) {}
4345

@@ -61,7 +63,10 @@ export class AuthenticationService {
6163
try {
6264
const userMod = await import('../user');
6365
const users = this.moduleRef.get(userMod.UserService, { strict: false });
64-
userId = await users.create(input, session);
66+
userId = await this.edgedb.usingOptions(
67+
disableAccessPolicies,
68+
async () => await users.create(input, session),
69+
);
6570
} catch (e) {
6671
// remap field prop as `email` field is at a different location in register() than createPerson()
6772
if (e instanceof DuplicateException && e.field === 'person.email') {

0 commit comments

Comments
 (0)