Skip to content

Commit 516ed7f

Browse files
committed
chore(auth): rename userLoggedIn endpoint
1 parent 256523f commit 516ed7f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/service/routes/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ router.post('/gitAccount', async (req, res) => {
142142
}
143143
});
144144

145-
router.get('/userLoggedIn', async (req, res) => {
145+
router.get('/me', async (req, res) => {
146146
if (req.user) {
147147
const user = JSON.parse(JSON.stringify(req.user));
148148
if (user && user.password) delete user.password;

src/ui/services/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const updateUser = async (data) => {
7777
};
7878

7979
const getUserLoggedIn = async (setIsLoading, setIsAdmin, setIsError, setAuth) => {
80-
const url = new URL(`${baseUrl}/api/auth/userLoggedIn`);
80+
const url = new URL(`${baseUrl}/api/auth/me`);
8181

8282
await axios(url.toString(), { withCredentials: true })
8383
.then((response) => {

test/testLogin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('auth', async () => {
4343
});
4444

4545
it('should now be able to access the user login metadata', async function () {
46-
const res = await chai.request(app).get('/api/auth/userLoggedIn').set('Cookie', `${cookie}`);
46+
const res = await chai.request(app).get('/api/auth/me').set('Cookie', `${cookie}`);
4747
res.should.have.status(200);
4848
});
4949

0 commit comments

Comments
 (0)