[PR #4074] [MERGED] HSB-445 feature: storing user last login timestamp #4646

Closed
opened 2026-03-17 02:09:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4074
Author: @mirarifhasan
Created: 5/19/2024
Status: Merged
Merged: 5/27/2024
Merged by: @balub

Base: nextHead: feat/user-last-login-time


📝 Commits (7)

  • c97d2e0 feat: lastLoggedOn added in schema and service function
  • 83f081d feat: add lastLoggedOn logic for magic link
  • 7c4f873 test: update test cases
  • d76f7c8 feat: add lastLoggedOn in gql model
  • 3048376 fix: nullable allowed in model attribute
  • c9d51d4 fix: resolve feedback
  • 909f87d feat: user last login interceptor added

📊 Changes

15 files changed (+123 additions, -34 deletions)

View changed files

packages/hoppscotch-backend/prisma/migrations/20240519093155_add_last_logged_on_to_user/migration.sql (+2 -0)
📝 packages/hoppscotch-backend/prisma/schema.prisma (+12 -11)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+2 -11)
📝 packages/hoppscotch-backend/src/auth/auth.controller.ts (+5 -0)
📝 packages/hoppscotch-backend/src/auth/auth.service.spec.ts (+13 -8)
📝 packages/hoppscotch-backend/src/auth/auth.service.ts (+3 -1)
packages/hoppscotch-backend/src/interceptors/user-last-login.interceptor.ts (+26 -0)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts (+1 -0)
📝 packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts (+1 -0)
📝 packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts (+1 -0)
📝 packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts (+1 -0)
📝 packages/hoppscotch-backend/src/user-settings/user-settings.service.spec.ts (+1 -0)
📝 packages/hoppscotch-backend/src/user/user.model.ts (+6 -0)
📝 packages/hoppscotch-backend/src/user/user.service.spec.ts (+28 -0)
📝 packages/hoppscotch-backend/src/user/user.service.ts (+21 -3)

📄 Description

Closes HSB-444

Description

This PR introduces the ability to store the user's last login timestamp in hoppscotch-backend package (in the user table). lastLoggedOn is the property to access the data. This value can be nullable for previous data.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

Nil


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4074 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 5/19/2024 **Status:** ✅ Merged **Merged:** 5/27/2024 **Merged by:** [@balub](https://github.com/balub) **Base:** `next` ← **Head:** `feat/user-last-login-time` --- ### 📝 Commits (7) - [`c97d2e0`](https://github.com/hoppscotch/hoppscotch/commit/c97d2e0776fabbc3299f63d3b4ea40f249a3a1bb) feat: lastLoggedOn added in schema and service function - [`83f081d`](https://github.com/hoppscotch/hoppscotch/commit/83f081d0ffc11a70521d81202a44acf2d567883a) feat: add lastLoggedOn logic for magic link - [`7c4f873`](https://github.com/hoppscotch/hoppscotch/commit/7c4f873bdc8beb84f4e2a76d6f9e1645522b2300) test: update test cases - [`d76f7c8`](https://github.com/hoppscotch/hoppscotch/commit/d76f7c8d0abdeee14fdfb276453e8c5eacb491e7) feat: add lastLoggedOn in gql model - [`3048376`](https://github.com/hoppscotch/hoppscotch/commit/3048376c210b851383dd6fcfc794a452fe739d0f) fix: nullable allowed in model attribute - [`c9d51d4`](https://github.com/hoppscotch/hoppscotch/commit/c9d51d44983d34744fb8cad21f89c3a6af0d7826) fix: resolve feedback - [`909f87d`](https://github.com/hoppscotch/hoppscotch/commit/909f87d1954b65860b2a7b75d91e1ae886b50750) feat: user last login interceptor added ### 📊 Changes **15 files changed** (+123 additions, -34 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-backend/prisma/migrations/20240519093155_add_last_logged_on_to_user/migration.sql` (+2 -0) 📝 `packages/hoppscotch-backend/prisma/schema.prisma` (+12 -11) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+2 -11) 📝 `packages/hoppscotch-backend/src/auth/auth.controller.ts` (+5 -0) 📝 `packages/hoppscotch-backend/src/auth/auth.service.spec.ts` (+13 -8) 📝 `packages/hoppscotch-backend/src/auth/auth.service.ts` (+3 -1) ➕ `packages/hoppscotch-backend/src/interceptors/user-last-login.interceptor.ts` (+26 -0) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts` (+1 -0) 📝 `packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts` (+1 -0) 📝 `packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts` (+1 -0) 📝 `packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts` (+1 -0) 📝 `packages/hoppscotch-backend/src/user-settings/user-settings.service.spec.ts` (+1 -0) 📝 `packages/hoppscotch-backend/src/user/user.model.ts` (+6 -0) 📝 `packages/hoppscotch-backend/src/user/user.service.spec.ts` (+28 -0) 📝 `packages/hoppscotch-backend/src/user/user.service.ts` (+21 -3) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HSB-444 ### Description <!-- Add a brief description of the pull request --> This PR introduces the ability to store the user's last login timestamp in `hoppscotch-backend` package (in the `user` table). `lastLoggedOn` is the property to access the data. This value can be nullable for previous data. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> Nil --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:09:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4646
No description provided.