Class: BaseAccountRouteMongo
Defined in: src/routes/mongo/BaseAccountRouteMongo.ts:8
Provides a single set of routes for working with a user's account data in aggregate.
Extends
Constructors
Constructor
new BaseAccountRouteMongo():
BaseAccountRouteMongo
Returns
BaseAccountRouteMongo
Inherited from
Properties
aliasClass
protectedaliasClass:any=AliasMongo
Defined in: src/routes/mongo/BaseAccountRouteMongo.ts:9
Overrides
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<AliasMongo>
Defined in: src/routes/BaseAccountRoute.ts:61
Inherited from
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: src/routes/BaseAccountRoute.ts:41
Inherited from
BaseAccountRoute.defaultScopes
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAccountRoute.ts:44
Inherited from
logger
protectedlogger:any
Defined in: src/routes/BaseAccountRoute.ts:50
Inherited from
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAccountRoute.ts:53
Inherited from
BaseAccountRoute.messagingUtils
profileClass
protectedprofileClass:any=ProfileMongo
Defined in: src/routes/mongo/BaseAccountRouteMongo.ts:10
Overrides
profileRepo?
protectedoptionalprofileRepo?:RepoUtils<ProfileMongo>
Defined in: src/routes/BaseAccountRoute.ts:62
Inherited from
rateLimiter?
protectedoptionalrateLimiter?:RateLimiter
Defined in: src/routes/BaseAccountRoute.ts:59
Inherited from
secretClass
protectedsecretClass:any=SecretMongo
Defined in: src/routes/mongo/BaseAccountRouteMongo.ts:11
Overrides
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<SecretMongo>
Defined in: src/routes/BaseAccountRoute.ts:63
Inherited from
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: src/routes/BaseAccountRoute.ts:56
Inherited from
trustedProxies
protectedtrustedProxies:string[] =[]
Defined in: src/routes/BaseAccountRoute.ts:67
Inherited from
BaseAccountRoute.trustedProxies
trustedRoles
protectedtrustedRoles:string[]
Defined in: src/routes/BaseAccountRoute.ts:47
Inherited from
userClass
protecteduserClass:any=UserMongo
Defined in: src/routes/mongo/BaseAccountRouteMongo.ts:12
Overrides
userRepo?
protectedoptionaluserRepo?:RepoUtils<UserMongo>
Defined in: src/routes/BaseAccountRoute.ts:64
Inherited from
Methods
cleanSecretData()
protectedcleanSecretData(obj):void
Defined in: src/routes/BaseAccountRoute.ts:107
Removes the data property from the secret(s) to protect sensitive information.
Parameters
obj
Returns
void
Inherited from
BaseAccountRoute.cleanSecretData
delete()
delete(
id,req,user):Promise<any>
Defined in: src/routes/BaseAccountRoute.ts:119
Parameters
id
string
req
HttpRequest
user
JWTUser
Returns
Promise<any>
Inherited from
get()
get(
id,user):Promise<any>
Defined in: src/routes/BaseAccountRoute.ts:151
Parameters
id
string
user
JWTUser
Returns
Promise<any>
Inherited from
initialize()
protectedinitialize():Promise<void>
Defined in: src/routes/BaseAccountRoute.ts:70
Returns
Promise<void>
Inherited from
resolveOwnedUid()
protectedresolveOwnedUid(id,user):string
Defined in: src/routes/BaseAccountRoute.ts:235
Resolves id (handling the "me" keyword) and verifies the caller either owns the targeted account
(targetUid === user.uid) or holds a trusted role. Throws 403 otherwise.
Parameters
id
string
user
JWTUser
Returns
string
Inherited from
BaseAccountRoute.resolveOwnedUid
revokeSessions()
revokeSessions(
id,req,user):Promise<void>
Defined in: src/routes/BaseAccountRoute.ts:205
Immediately revokes every outstanding refresh token for the account (self-service, or any account's if the caller holds a trusted role) — the standard "log out everywhere" action, e.g. after a suspected account compromise.
This does NOT invalidate an already-issued access token, which remains valid until its own natural
(short) expiry regardless of this call — true immediate access-token revocation would require a
persistent revocation check on every single request, which the underlying JWT verification
(@rapidrest/service-core's JWTStrategy, an external package this library doesn't control) doesn't
support; it does a stateless signature/expiry check only, with no per-request datastore lookup. What
this does reliably stop going forward is BaseAuthRefreshRoute minting any new access token from a
refresh token issued before this call — see the iat check there. This includes the caller's own
current session: there is no "everywhere but here" variant, matching the equivalent behavior in most
other systems that offer this action.
Parameters
id
string
req
HttpRequest
user
JWTUser
Returns
Promise<void>