Skip to content

Commit a3a11d3

Browse files
committed
feat(groups): BAAS-136 - support new group paths
1 parent 5745846 commit a3a11d3

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Diff for: src/auth.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,7 @@ export default class Auth {
221221
}
222222

223223
authedId() {
224-
let id = ((this.get() || {}).user || {})._id;
225-
if (id) {
226-
return {'$oid': id};
227-
}
224+
return ((this.get() || {}).user || {})._id;
228225
}
229226

230227
isImpersonatingUser() {

Diff for: test/test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('Auth', () => {
108108
const testUser = {'foo': 'bar', 'biz': 'baz', 'user': {'_id': hexStr}};
109109
a.set(testUser);
110110
expect(a.get()).toEqual(testUser);
111-
expect(a.authedId()).toEqual({'$oid': hexStr});
111+
expect(a.authedId()).toEqual(hexStr);
112112

113113
a.clear();
114114
expect(a.get()).toBeNull();
@@ -118,15 +118,15 @@ describe('Auth', () => {
118118
expect.assertions(1);
119119
const a = new Auth('/auth');
120120
return a.localAuth('user', 'password', true).then(() => {
121-
expect(a.authedId()).toEqual({'$oid': hexStr});
121+
expect(a.authedId()).toEqual(hexStr);
122122
});
123123
});
124124

125125
it('should allow setting access tokens', () => {
126126
expect.assertions(3);
127127
const a = new Auth('/auth');
128128
return a.localAuth('user', 'password', true).then(() => {
129-
expect(a.authedId()).toEqual({'$oid': hexStr});
129+
expect(a.authedId()).toEqual(hexStr);
130130
expect(a.get()['accessToken']).toBeUndefined();
131131
a.setAccessToken('foo');
132132
expect(a.get()['accessToken']).toEqual('foo');
@@ -138,7 +138,7 @@ describe('Auth', () => {
138138
let testClient = new BaasClient('testapp');
139139
return testClient.authManager.localAuth('user', 'password', true)
140140
.then(() => {
141-
expect(testClient.authedId()).toEqual({'$oid': hexStr});
141+
expect(testClient.authedId()).toEqual(hexStr);
142142
expect(testClient.authError()).toBeFalsy();
143143
expect(testClient.auth()).toEqual({user: {_id: hexStr}});
144144
})

0 commit comments

Comments
 (0)