EduShade
Auth Module

User Management (Admin)

Admin tools for creating, filtering, editing, deleting, exporting, and inspecting users — including direct credential edits and cross-service filters

User Management (Admin)

The User Management area is an admin-only surface where administrators create, filter, edit, monitor, and (soft-)delete platform users.

Accessing User Management

  1. Sign in as an Admin or Instructor with user management permissions.
  2. Navigate to Admin → Users (/admin/users).
  3. Required permission: user.list to view, user.view to open profiles.

There are also dedicated sub-lists:

PagePath
All users/admin/users
Learners/admin/users/learners
Admins/admin/users/admins
Instructors/admin/users/instructors
Roles & Permissions/admin/users/roles

User List

A comprehensive, filterable, paginated table of all platform users (GET /v1/users).

Available Columns

  • Name and avatar
  • Email, phone, username, unique ID
  • Status (active, inactive, suspended, pending_verification, deleted)
  • User type flags (is_admin, is_instructor, is_learner)
  • Roles
  • Registration date, last login

Filtering Users

The user list backs onto a rich UserFilters DTO (see auth-service/dto/user.go). Filters can be combined freely.

Identity & status:

FilterDescription
SearchFuzzy match across name, email, phone, username, unique ID
Status / StatusesOne or many of: active, inactive, suspended, pending_verification, deleted
User typeAdmin, Instructor, Learner (is_admin, is_instructor, is_learner)
Verificationemail_verified, phone_verified
Auth methodemail, phone, oauth
OAuthhas_oauth, oauth_provider (google / facebook / github / apple)
Has password sethas_password
RolesFilter by assigned role(s)

Profile & demographics:

FilterDescription
Profile completeprofile_complete=true/false (uses backend completeness scoring)
Has avatar / bio / locationBoolean filters
Country / city / state / continent / timezone / localeGeographic filters
Gender, designation, expertise, age min/maxDemographic filters

Activity:

FilterDescription
created_after / created_beforeDate range on registration
created_in_last_days"registered within last N days"
last_login_after / last_login_before / active_in_last_days / inactive_for_daysActivity windows
is_locked, failed_login_attempts_min, failed_login_attempts_maxAccount security state

Cross-Service Filters

The user list joins data from other microservices when those service databases are reachable:

FilterSource serviceDescription
has_enrollmentsLearningUsers with at least one enrollment
enrollment_statusLearningactive, completed, cancelled, expired, suspended
enrolled_program_type, enrolled_program_idsLearningFilter to specific course/program types or IDs
progress_min, progress_maxLearningLearners within a progress range
total_time_spent_minLearningMinimum aggregate learning time
last_learning_activity_afterLearningActive in learning since a given date

Cross-service filters require the auth-service to have a working DB connection to the learning-service database. Failures are non-fatal — affected filters are simply skipped.

Filter Values & Suggestions

  • GET /v1/users/filter-values — returns all available values for static filters (statuses, roles, countries, oauth_providers, auth_methods, etc.).
  • GET /v1/users/field-values — paginated dynamic field-value lookup for autocomplete (e.g. while typing a designation).

Sorting & Pagination

Sort by name, email, registration date, last login, or status. Page size is configurable; total count is returned with each page.

Creating a New User

Admins can create user accounts directly without registration.

  1. Click Create User at /admin/users/create (requires user.create).
  2. Fill in the form:
FieldRequiredNotes
NameYesDisplay name
EmailConditionalRequired if no phone
PhoneConditionalRequired if no email
UsernameNo3+ chars, lowercase letters/digits/.-_, unique per tenant
PasswordNoIf omitted, the user must reset before logging in
StatusYesDefault: active
User type flagsAt least oneis_admin, is_instructor, is_learner
RolesRequired for admin/instructorPick at least one role for those types
Direct permissionsNoOptional one-off grants
  1. Click Create.

API: POST /v1/users.

Editing a User

Open a user's edit form at /admin/users/{userID}/edit/edit-user (requires user.update). The edit form is split into multiple tabs:

TabPathWhat it does
Overview…/edit/overviewProfile snapshot
Edit user…/edit/edit-userMain form (name, email, phone, username, password, status, roles, profile fields)
Sessions…/edit/users-sessionsView / terminate sessions
Impersonation…/edit/impersonationStart impersonation or masquerade
Audit logs & admin notes…/edit/audit-logs-admin-notesPer-user audit trail
Unique ID generation…/edit/unique-id-generationGenerate or update unique ID
Account deletion…/edit/account-deletationInitiate user account deletion

Admin Direct Credential Edits

The edit form lets admins change another user's email, phone, username, or password directlyno OTP, no password-reset email, no user consent required. This is intentionally privileged: admins are trusted to perform out-of-band identity verification.

  • Endpoint: PUT /v1/users/{user_id} (requires user.update)
  • Affected fields: email, phone, username, password
  • A successful credential change is published as an audit event so the admin who performed it is recorded.
  • Best practice: terminate the user's existing sessions after a password change so any stale tokens stop working.

Updating Status

Status changes flow through the same edit endpoint — set status to one of:

ValueEffect
pending_verificationForces the user back through email/phone verification on next login
activeNormal operating state
inactiveTemporarily disables login
suspendedDisables login with a "suspended" message
deletedSoft delete — same effect as user-initiated deletion

Updating Unique ID

Open the Unique ID Generation tab to assign or change a user's tenant-unique identifier.

  • Endpoint: PUT /v1/users/{user_id}/unique-id (requires user.update)

Deleting Users

Single User Delete

  1. Click Delete in the user row or from the user's edit page (requires user.delete).
  2. Confirm.
  3. The user is soft-deleted (deleted_at set, status set to deleted).
  4. All sessions are terminated.

API: DELETE /v1/users/{user_id}.

Bulk Delete

  1. Apply filters or select multiple users.
  2. Click Bulk Delete (requires user.delete).
  3. Confirm.

API: DELETE /v1/users/bulk/delete.

See Account Deletion for what soft-delete preserves and how reactivation works.

Exporting Users

Export user data as a CSV for reporting or external analysis.

  1. Apply your filters (the export respects current filters).
  2. Click Export (requires user.export).
  3. A CSV download includes name, email, phone, username, status, user type, registration / last login timestamps, country, timezone, and all profile fields.

API: GET /v1/users/bulk/export.

Managing User Sessions (Admin)

From the Sessions tab on a user's edit page:

  • View all active sessions with device + IP-geolocation details.
  • Terminate a single session: DELETE /v1/users/{user_id}/sessions/{session_id}
  • Terminate all of a user's sessions: DELETE /v1/users/{user_id}/sessions

Both require user.update.

OAuth Account Linking (Admin)

Admins can link/unlink OAuth providers programmatically:

  • Link: POST /v1/users/{user_id}/oauth/link
  • Unlink: POST /v1/users/{user_id}/oauth/unlink

These accept a provider_user_id and are intended for scripted account migration rather than ad-hoc UI use, since admins typically don't have the user's raw provider ID.

User Statistics & Analytics

Available straight from the user-management area:

EndpointUse
GET /v1/users/statsCounts by status, type, verification, recent registrations
GET /v1/users/analytics/overviewQuick stats dashboard (period-over-period)
GET /v1/users/analytics/growthsDaily / weekly / monthly growth time series

See User Analytics for details. Backed by the mv_user_quick_stats materialized view, refreshed every 2 minutes.

System API (Inter-Service)

The auth-service exposes system-protected APIs (separate auth scheme via system token, not user JWT) for other microservices to consume:

EndpointPurpose
POST /v1/system/users/get-or-createIdempotent upsert by email/phone — used during invitations and cross-service user resolution
GET /v1/system/users/searchCross-service user search
GET /v1/system/users/by-idsBatch fetch by ID list
POST /v1/system/users/{user_id}/rolesAssign roles
POST /v1/system/users/{user_id}/permissionsAssign direct permissions
PATCH /v1/system/users/{user_id}/flagsSet is_admin / is_instructor / is_learner
GET /v1/system/rolesLook up role by name

These are not accessible to regular users.

Troubleshooting

IssueSolution
Can't see User ManagementEnsure you have user.list
Can't create usersEnsure you have user.create
Can't delete usersEnsure you have user.delete
Export not workingEnsure you have user.export, and try fewer filters
Cross-service filters return nothingThe learning-service DB may be unreachable — check service health
Direct password edit didn't end the user's existing sessionsTerminate sessions explicitly from the Sessions tab
Bulk filters slowCross-service joins (enrollment, progress) can be slow on large datasets — narrow the time window first

On this page