CkAuthExtractors class
Maps CkResponse.data (dynamic) to tokens, profile, and messages.
Non-generic — holds extractors for tokens, profile, verification tokens,
and messages. The profile callback returns dynamic (your profile model).
Use CkAuthExtractors.standard for typical { accessToken, user, ... } payloads.
Constructors
-
CkAuthExtractors({required String? accessToken(dynamic data), String? refreshToken(dynamic data)?, dynamic profile(dynamic data)?, Map<
CkOtpTrigger, String? Function(dynamic data)> ? verificationTokens, String? resetPasswordToken(dynamic data)?, String? message(dynamic data)?}) -
const
-
CkAuthExtractors.fromPaths({required String accessTokenPath, String? refreshTokenPath, String? profilePath, String? messagePath, String? resetPasswordTokenPath, Map<
CkOtpTrigger, String> ? verificationTokenPaths = const {CkOtpTrigger.signup : 'createUserToken', CkOtpTrigger.login : 'loginUserToken', CkOtpTrigger.forgetPassword : 'forgetToken'}}) -
factory
-
CkAuthExtractors.standard({String accessTokenKey = 'accessToken', String refreshTokenKey = 'refreshToken', String profileKey = 'user', String messageKey = 'message', String resetPasswordTokenKey = 'token', Map<
CkOtpTrigger, String> ? verificationTokenKeys = const {CkOtpTrigger.signup : 'createUserToken', CkOtpTrigger.login : 'loginUserToken', CkOtpTrigger.forgetPassword : 'forgetToken'}}) -
Standard keys on CkResponse.data (post-envelope
datapayload).factory
Properties
- accessToken → String? Function(dynamic data)
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String? Function(dynamic data)?
-
final
- profile → dynamic Function(dynamic data)?
-
Extracts profile from API response data (dynamic → your profile model).
final
- refreshToken → String? Function(dynamic data)?
-
final
- resetPasswordToken → String? Function(dynamic data)?
-
Extractor for password reset token returned upon successful OTP verification.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
verificationTokens
→ Map<
CkOtpTrigger, String? Function(dynamic data)> ? -
Trigger-specific verification token extractors.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited