Line data Source code
1 : import 'package:freezed_annotation/freezed_annotation.dart';
2 :
3 : import '../../../types.dart';
4 :
5 : part 'id_token_result.freezed.dart';
6 : part 'id_token_result.g.dart';
7 :
8 : // A model of FlutterFire's IdTokenResult:
9 : // https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_auth/firebase_auth_platform_interface/lib/src/id_token_result.dart
10 : @freezed
11 : class IdTokenResult with _$IdTokenResult, ReduxState {
12 : static const String className = 'IdTokenResult';
13 :
14 0 : const IdTokenResult._();
15 : factory IdTokenResult({
16 : /// The authentication time formatted as UTC string. This is the time the user
17 : /// authenticated (signed in) and not the time the token was refreshed.
18 : DateTime? authTime,
19 :
20 : /// The entire payload claims of the ID token including the standard reserved
21 : /// claims as well as the custom claims.
22 : Map<String, dynamic>? claims,
23 :
24 : /// The time when the ID token expires.
25 : DateTime? expirationTime,
26 :
27 : /// The time when ID token was issued.
28 : DateTime? issuedAtTime,
29 :
30 : /// The sign-in provider through which the ID token was obtained (anonymous,
31 : /// custom, phone, password, etc), converted to [ProvidersEnum].
32 : ProvidersEnum? signInProvider,
33 :
34 : /// The Firebase Auth ID token JWT string.
35 : String? token,
36 : }) = _IdTokenResult;
37 :
38 0 : factory IdTokenResult.fromJson(JsonMap json) => _$IdTokenResultFromJson(json);
39 :
40 0 : @override
41 : String get typeName => className;
42 : }
|