@pbvex/client / AuthCollection
Class: AuthCollection<T>
Type Parameters
T
T extends AuthRecord = AuthRecord
Constructors
Constructor
new AuthCollection<
T>(name,request,store,oauth):AuthCollection<T>
Parameters
name
string
request
store
AuthStore<T>
oauth
(collection, options) => Promise<AuthResponse<T>>
Returns
AuthCollection<T>
Methods
authRefresh()
authRefresh(
options?):Promise<AuthResponse<T>>
Parameters
options?
Returns
Promise<AuthResponse<T>>
authWithOAuth2()
authWithOAuth2(
options):Promise<AuthResponse<T>>
Parameters
options
Returns
Promise<AuthResponse<T>>
authWithOAuth2Code()
authWithOAuth2Code(
provider,code,codeVerifier,redirectURL,createData?,options?):Promise<AuthResponse<T>>
Parameters
provider
string
code
string
codeVerifier
string
redirectURL
string
createData?
Record<string, unknown>
options?
Returns
Promise<AuthResponse<T>>
authWithOTP()
authWithOTP(
otpId,password,options?):Promise<AuthResponse<T>>
Parameters
otpId
string
password
string
options?
Returns
Promise<AuthResponse<T>>
authWithPassword()
authWithPassword(
identity,password,options?):Promise<AuthResponse<T>>
Parameters
identity
string
password
string
options?
Returns
Promise<AuthResponse<T>>
confirmEmailChange()
confirmEmailChange(
token,password,options?):Promise<true>
Parameters
token
string
password
string
options?
Returns
Promise<true>
confirmPasswordReset()
confirmPasswordReset(
token,password,passwordConfirm,options?):Promise<true>
Parameters
token
string
password
string
passwordConfirm
string
options?
Returns
Promise<true>
confirmVerification()
confirmVerification(
token,options?):Promise<true>
Parameters
token
string
options?
Returns
Promise<true>
create()
create(
data,options?):Promise<T>
Parameters
data
Record<string, unknown>
options?
Returns
Promise<T>
impersonate()
impersonate(
recordId,duration?,options?):Promise<AuthResponse<T>>
Returns impersonated auth data without replacing the current (usually superuser) store.
Parameters
recordId
string
duration?
number = 0
options?
Returns
Promise<AuthResponse<T>>
listAuthMethods()
listAuthMethods(
options?):Promise<AuthMethodsList>
Parameters
options?
Returns
Promise<AuthMethodsList>
requestEmailChange()
requestEmailChange(
newEmail,options?):Promise<true>
Parameters
newEmail
string
options?
Returns
Promise<true>
requestOTP()
requestOTP(
options?):Promise<OtpResponse>
Parameters
email
string
options?
Returns
Promise<OtpResponse>
requestPasswordReset()
requestPasswordReset(
options?):Promise<true>
Parameters
email
string
options?
Returns
Promise<true>
requestVerification()
requestVerification(
options?):Promise<true>
Parameters
email
string
options?
Returns
Promise<true>