You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -548,28 +551,59 @@ export default class GoTrueClient {
548
551
}
549
552
550
553
/**
551
-
* Sets the session data from refresh token and returns current session or an error if the refresh token is invalid.
552
-
* @param refresh_token A refresh token returned by supabase auth.
554
+
* Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.
555
+
* If the refresh token in the current session is invalid and the current session has expired, an error will be thrown.
556
+
* If the current session does not contain at expires_at field, setSession will use the exp claim defined in the access token.
557
+
* @param currentSession The current session that minimally contains an access token, refresh token and a user.
Copy file name to clipboardExpand all lines: src/lib/types.ts
+43-7
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,15 @@ export type UserResponse =
139
139
}
140
140
141
141
exportinterfaceSession{
142
+
/**
143
+
* The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.
144
+
*/
142
145
provider_token?: string|null
146
+
/**
147
+
* The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.
148
+
* Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.
149
+
*/
150
+
provider_refresh_token?: string|null
143
151
/**
144
152
* The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.
0 commit comments