File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ trait FirebaseAuthenticable
11
11
*/
12
12
protected $ claims ;
13
13
14
+ /**
15
+ * Firebase token.
16
+ *
17
+ * @var string|null
18
+ */
19
+ protected $ firebaseAuthenticationToken ;
20
+
14
21
/**
15
22
* Get User by claim.
16
23
*
@@ -79,6 +86,30 @@ public function transformClaims(array $claims): array
79
86
return $ attributes ;
80
87
}
81
88
89
+ /**
90
+ * Set firebase token.
91
+ *
92
+ * @param string $token
93
+ *
94
+ * @return self
95
+ */
96
+ public function setFirebaseAuthenticationToken ($ token )
97
+ {
98
+ $ this ->firebaseAuthenticationToken = $ token ;
99
+
100
+ return $ this ;
101
+ }
102
+
103
+ /**
104
+ * Get firebase token.
105
+ *
106
+ * @return string
107
+ */
108
+ public function getFirebaseAuthenticationToken ()
109
+ {
110
+ return $ this ->firebaseAuthenticationToken ;
111
+ }
112
+
82
113
/**
83
114
* Get the name of the unique identifier for the user.
84
115
*
Original file line number Diff line number Diff line change @@ -40,10 +40,11 @@ public function user(Request $request)
40
40
}
41
41
42
42
try {
43
- $ token = $ this ->verifier ->verifyIdToken ($ token );
43
+ $ firebaseToken = $ this ->verifier ->verifyIdToken ($ token );
44
44
45
45
return app (config ('auth.providers.users.model ' ))
46
- ->resolveByClaims ($ token ->getClaims ());
46
+ ->setFirebaseAuthenticationToken ($ token )
47
+ ->resolveByClaims ($ firebaseToken ->getClaims ());
47
48
} catch (\Exception $ e ) {
48
49
if (config ('app.debug ' )) {
49
50
throw $ e ;
You can’t perform that action at this time.
0 commit comments