@@ -30,7 +30,7 @@ export type AuthContextType = {
3030 isAuthenticated : boolean ;
3131 isLoading : boolean ;
3232 permissions ?: PermissionsType ;
33- signIn : ( data : { username : string ; password : string } , callback ?: ( ) => void ) => Promise < void > ;
33+ login : ( data : { username : string ; password : string } , callback ?: ( ) => void ) => Promise < void > ;
3434 signOut : ( callback ?: ( ) => void ) => void ;
3535 setToken : ( token : UserToken ) => void ;
3636 user : User | null ;
@@ -90,7 +90,7 @@ export const AuthContext = createContext<AuthContextType>({
9090 isAdmin : false ,
9191 write : false ,
9292 } ,
93- signIn : async ( ) => { } ,
93+ login : async ( ) => { } ,
9494 signOut : ( ) => { } ,
9595 setToken : ( ) => { } ,
9696 user : null ,
@@ -113,7 +113,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
113113 } ;
114114
115115 const result : components [ "schemas" ] [ "UserToken" ] = await fetchUrl (
116- CONFIG . AUTH_SIGN_IN_URL ,
116+ CONFIG . AUTH_LOGIN_URL ,
117117 payload
118118 ) ;
119119
@@ -147,7 +147,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
147147 write : WRITE_ROLES . includes ( data ?. user_claims ?. role ) ,
148148 isAdmin : ADMIN_ROLES . includes ( data ?. user_claims ?. role ) ,
149149 } ,
150- signIn,
150+ login : signIn ,
151151 signOut,
152152 setToken,
153153 user : data ?. sub ? { id : data ?. sub } : null ,
@@ -167,9 +167,9 @@ export function RequireAuth({ children }: { children: ReactElement }) {
167167
168168 if ( isAuthenticated || config ?. main ?. allow_anonymous_access ) return children ;
169169
170- // Redirect them to the /signin page, but save the current location they were
170+ // Redirect them to the /login page, but save the current location they were
171171 // trying to go to when they were redirected. This allows us to send them
172172 // along to that page after they log in, which is a nicer user experience
173173 // than dropping them off on the home page.
174- return < Navigate to = "/signin " state = { { from : location } } replace /> ;
174+ return < Navigate to = "/login " state = { { from : location } } replace /> ;
175175}
0 commit comments