diff --git a/spec/providers/auth.spec.ts b/spec/providers/auth.spec.ts index 4573d111d..805d01b8b 100644 --- a/spec/providers/auth.spec.ts +++ b/spec/providers/auth.spec.ts @@ -146,33 +146,5 @@ describe('AuthBuilder', () => { return expect(cloudFunction(event)).to.eventually.deep.equal(event.data); }); - - it('should reformat a url-formatted UID', () => { - const cloudFunction = auth.user().onCreate((ev: Event) => ev.data); - let event: Event = { - data: { - uid: 'http://github.com/abcde12345', - }, - } as any; - return expect(cloudFunction(event)).to.eventually.deep.equal( - { - uid: 'abcde12345', - }, - ); - }); - - it('should not reformat legally-formatted UIDs', () => { - const cloudFunction = auth.user().onCreate((ev: Event) => ev.data); - let event: Event = { - data: { - uid: 'abcde12345', - }, - } as any; - return expect(cloudFunction(event)).to.eventually.deep.equal( - { - uid: 'abcde12345', - }, - ); - }); }); }); diff --git a/src/providers/auth.ts b/src/providers/auth.ts index 8dab85164..1a982e402 100644 --- a/src/providers/auth.ts +++ b/src/providers/auth.ts @@ -51,18 +51,6 @@ export class UserBuilder { } } - // It is possible that the incoming UID is formatted as a URL, for example: "http://github.com/12345". - // That format would break our spec, since... - // - The Admin SDK would return a UserRecord with a UID of just "12345". - // - The UserRecord UID is supposed to be usable as a key in the Firebase Realtime Database, which is - // impossible with this slash-based format. - // Hence, we'll re-format the UID here, if it was indeed supplied as a URL. - // We won't use string.split(), since it's not available on older versions of node. - // BUG(36486645) - if (raw.data.uid) { - raw.data.uid = raw.data.uid.substring(raw.data.uid.lastIndexOf('/') + 1); - } - return raw.data; }