@@ -5,6 +5,7 @@ import JWT from 'jsonwebtoken';
5
5
import { DateTime } from 'luxon' ;
6
6
import { Writable } from 'ts-essentials' ;
7
7
import { sessionFromContext } from '~/common/session' ;
8
+ import { disableAccessPolicies , EdgeDB } from '~/core/edgedb' ;
8
9
import {
9
10
DuplicateException ,
10
11
GqlContextType ,
@@ -38,6 +39,7 @@ export class AuthenticationService {
38
39
private readonly privileges : Privileges ,
39
40
@Logger ( 'authentication:service' ) private readonly logger : ILogger ,
40
41
private readonly repo : AuthenticationRepository ,
42
+ private readonly edgedb : EdgeDB ,
41
43
private readonly moduleRef : ModuleRef ,
42
44
) { }
43
45
@@ -61,7 +63,10 @@ export class AuthenticationService {
61
63
try {
62
64
const userMod = await import ( '../user' ) ;
63
65
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
+ ) ;
65
70
} catch ( e ) {
66
71
// remap field prop as `email` field is at a different location in register() than createPerson()
67
72
if ( e instanceof DuplicateException && e . field === 'person.email' ) {
0 commit comments