Skip to content

Latest commit

 

History

History
213 lines (120 loc) · 5.04 KB

_become_.md

File metadata and controls

213 lines (120 loc) · 5.04 KB

meteor-become"become"

External module: "become"

Index

Modules

Type aliases

Variables

Functions

Object literals

Type aliases

PolicyFunction

Ƭ PolicyFunction: function

Defined in become.ts:35

Type declaration:

▸ (from: User, to: User): boolean

Parameters:

Name Type
from User
to User

Variables

Const BECOME_LOGIN_TOKEN_KEY

BECOME_LOGIN_TOKEN_KEY: "Become.origLoginToken" = "Become.origLoginToken"

Defined in become.ts:12


Const METEOR_LOGIN_TOKEN_KEY

METEOR_LOGIN_TOKEN_KEY: "Meteor.loginToken" = "Meteor.loginToken"

Defined in become.ts:11


Const REAL_USER_KEY

REAL_USER_KEY: "Become.realUser" = "Become.realUser"

Defined in become.ts:13


Const debug

debug: Debugger = debug_('meteor-become')

Defined in become.ts:9

Functions

Let becomePolicy

becomePolicy(_from: User, _to: User): false

Defined in become.ts:36

Parameters:

Name Type
_from User
_to User

Returns: false

Object literals

Const Become

Become: object

Defined in become.ts:38

become

become(targetUserID: string): Promise‹void›

Defined in become.ts:51

Become another user.

Invoke the login method on the server with the "become" optional argument set to targetUserID. Upon success, update all relevant state.

locus Client

Parameters:

Name Type Description
targetUserID string The ID of the target user in Meteor.users

Returns: Promise‹void›

policy

policy(policy: PolicyFunction): void

Defined in become.ts:108

Set the policy.

Parameters:

Name Type
policy PolicyFunction

Returns: void

realUser

realUser(): any

Defined in become.ts:73

The user the client was originally logged in as. A reactive data source.

Returns: any

restore

restore(): void

Defined in become.ts:93

Log out of the account one has become, and back to the main identity.

Initiate the process of disconnecting and reconnecting as the original user. Has no effect if the client is not currently acting as another user.

Note: this method, like the underlying Meteor.reconnect method, doesn't signal completion via callback nor promise. However, one can react to changes in Meteor.userId et al, or set callbacks with Accounts.onLogin and Accounts.onLoginFailure

Returns: void


Const Token

Token: object

Defined in become.ts:21

get

get(): string | null

Defined in become.ts:22

Returns: string | null

restore

restore(): void

Defined in become.ts:28

Returns: void

save

save(token: string | null): void

Defined in become.ts:25

Parameters:

Name Type
token string | null

Returns: void