File tree Expand file tree Collapse file tree
test/integration/ce/authentication
shared/src/lib/authentication/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export async function getProjectAndToken(
4040
4141 const token = await accessTokenManager . generateToken ( {
4242 id : user . id ,
43+ externalId : user . externalId ,
4344 type : PrincipalType . USER ,
4445 projectId : project . id ,
4546 organization : {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ type NewUserParams = {
2323 verified : boolean ;
2424 organizationId : string | null ;
2525 provider : Provider ;
26+ externalId ?: string ;
2627} ;
2728
2829type NewUserResponse = {
@@ -70,6 +71,7 @@ const createEditorUser = async (
7071 newsLetter : params . newsLetter ,
7172 password : params . password ,
7273 organizationId : params . organizationId ,
74+ externalId : params . externalId ,
7375 } ;
7476
7577 return await userService . create ( newUser ) ;
Original file line number Diff line number Diff line change @@ -211,6 +211,16 @@ export const userService = {
211211 } ) ;
212212 } ,
213213
214+ async updateExternalId ( {
215+ id,
216+ newExternalId,
217+ } : UpdateExternalIdParams ) : Promise < void > {
218+ await userRepo ( ) . update ( id , {
219+ updated : dayjs ( ) . toISOString ( ) ,
220+ externalId : newExternalId ,
221+ } ) ;
222+ } ,
223+
214224 async updateTracking ( {
215225 id,
216226 trackEvents,
@@ -322,6 +332,11 @@ type UpdateEmailParams = {
322332 newEmail : string ;
323333} ;
324334
335+ type UpdateExternalIdParams = {
336+ id : UserId ;
337+ newExternalId ?: string ;
338+ } ;
339+
325340type UpdateTrackingParams = {
326341 id : UserId ;
327342 trackEvents : boolean ;
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ beforeAll(async () => {
8484
8585 adminToken = await accessTokenManager . generateToken ( {
8686 id : mockAdminUser . id ,
87+ externalId : mockAdminUser . externalId ,
8788 type : PrincipalType . USER ,
8889 projectId : mockProject . id ,
8990 organization : {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { PrincipalType } from './principal-type';
55
66export type Principal = {
77 id : OpenOpsId ;
8+ externalId ?: string ;
89 type : PrincipalType ;
910 projectId : ProjectId ;
1011 organization : {
You can’t perform that action at this time.
0 commit comments