@@ -56,8 +56,9 @@ type AuthContextType = {
56
56
const AuthContext = createContext < AuthContextType | undefined > ( undefined ) ;
57
57
58
58
export type AuthProviderProps = {
59
- authEndpoint : string ;
59
+ refreshTokenEndpoint : string ;
60
60
refreshTokenMutation : string ;
61
+ logoutEndpoint : string ;
61
62
logoutMutation : string ;
62
63
cookieNames ?: CookieNames ;
63
64
} ;
@@ -159,7 +160,7 @@ export function AuthProvider({
159
160
const checkToken = useCallback ( async ( ) => {
160
161
const token = await getAccessToken ( ) ;
161
162
updateAuthState ( token ) ;
162
- } , [ options . authEndpoint , updateAuthState ] ) ;
163
+ } , [ options . refreshTokenEndpoint , updateAuthState ] ) ;
163
164
164
165
// Load initial auth state when mounting the application
165
166
useEffect ( ( ) => {
@@ -292,7 +293,7 @@ export function AuthProvider({
292
293
const refreshAccessToken = async ( ) : Promise < boolean > => {
293
294
// Since we are storing the refresh token in a cookie this will be sent
294
295
// automatically by the browser.
295
- const response = await fetch ( options . authEndpoint , {
296
+ const response = await fetch ( options . refreshTokenEndpoint , {
296
297
method : "POST" ,
297
298
body : options . refreshTokenMutation ,
298
299
headers : {
@@ -320,7 +321,7 @@ export function AuthProvider({
320
321
const clearTokens = async ( ) => {
321
322
// Since we are storing the refresh token in a cookie this will be sent
322
323
// automatically by the browser.
323
- const response = await fetch ( options . authEndpoint , {
324
+ const response = await fetch ( options . logoutEndpoint , {
324
325
method : "POST" ,
325
326
body : options . logoutMutation ,
326
327
headers : {
0 commit comments