# Skip Login

{% tabs %}
{% tab title="VITE (TS)" %}

## **Disable Authentication Temporary**

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

1. Comment out the AuthGuard wrapper for the routes within the file below: `src/routes/MainRoutes.tsx`

{% code title="src/routes/MainRoutes.tsx" %}

```typescript
// import AuthGuard from 'utils/route-guard/AuthGuard';

...
...
const MainRoutes = {
    path: '/',
    element: (
        // <AuthGuard>
        <MainLayout />
        // </AuthGuard>
    ),
    ...
}
```

{% endcode %}

In the code snippet above, the `<AuthGuard>` a component is commented out, allowing the routes within the `MainLayout` component to be rendered without authentication protection. To enable the AuthGuard wrapper again, remove the comment markers (`//`) surrounding the `<AuthGuard>` component.

***

## Remove Authentication Permanent   &#x20;

If you want to permanently remove authentication from a system or application, here are the steps to follow:

1. **Remove below authentication keys below from `.env` file.**

{% code title=".env" %}

```typescript
...
...
## Firebase - Google Auth 
VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=

## AWS
VITE_APP_AWS_POOL_ID=
VITE_APP_AWS_APP_CLIENT_ID=

## Auth0
VITE_APP_AUTH0_CLIENT_ID=
VITE_APP_AUTH0_DOMAIN=
...
...
```

{% endcode %}

2. **Removed below list of files and directories.**

```typescript
..
├── src
│   ├── ui-component\cards               
│   │   ├── AuthFooter.tsx
│   ├── context
│   │   ├── Auth0Context.tsx
│   │   ├── AWSCognitoContext.tsx
│   │   ├── FirebaseContext.tsx
│   │   ├── JWTContext.tsx
│   ├── hooks
│   │   ├── useAuth.ts
│   ├── views
│   │   ├── pages
│   │   │   ├── authentication (remove directory with all sub files)
│   ├── routes
│   │   ├── LoginRoutes.tsx
│   │   ├── AuthenticationRoutes.tsx
│   ├── types
│   │    ├── auth.ts
│   ├── utils
│   │   ├── route-guard (remove directory with all sub files)
...
```

**Remove `LoginRoutes and AuthenticationRoutes`**- \
Open file `src/routes/index.tsx`, and remove `LoginRoutes`, `AuthenticationRoutes` import.

{% code title="src/routes/index.tsx" %}

```typescript
import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

// routes
import MainRoutes from './MainRoutes';
import SimpleRoutes from './SimpleRoutes';

// project imports
import Loadable from 'ui-component/Loadable';

const PagesLanding = Loadable(lazy(() => import('views/pages/landing')));

// ==============================|| ROUTING RENDER ||============================== //

const router = createBrowserRouter(
  [{ path: '/', element: <PagesLanding /> }, SimpleRoutes, MainRoutes],
  {
    basename: import.meta.env.VITE_APP_BASE_NAME
  }
);

export default router;
```

{% endcode %}

4. **Remove or change `/login` routes.**&#x20;
   1. &#x20;**If you want to remove routes**, remove the router component `RouterLink` or `Link` with `to=''` props.
   2. **If you want to change url**, set the home page URL like, `to={DASHBOARD_PATH}` , And import `DASHBOARD_PATH` from `config` file.
5. **Remove `useAuth` hook** - Remove the below imports from throughout the project and set static values for user profile props.

```typescript
import useAuth from 'hooks/useAuth';
```

6. **Remove the axios interceptors response from&#x20;*****the ./src/utils/axios.ts*****&#x20;file. So the final version should look like below:**

{% code title="utils/axios.ts" %}

```typescript
import axios, { AxiosRequestConfig } from 'axios';

const axiosServices = axios.create({ baseURL: import.meta.env.VITE_APP_API_URL || 'http://localhost:3010/' });

export default axiosServices;

// ==============================|| AXIOS - FOR MOCK SERVICES ||============================== //

export const fetcher = async (args: string | [string, AxiosRequestConfig]) => {
    const [url, config] = Array.isArray(args) ? args : [args];

    const res = await axiosServices.get(url, { ...config });

    return res.data;
};
```

{% endcode %}

7. **Remove import of `JWTProvider` from ./src/App.tsx**
8. **Remove import and usage of `AuthGuard` from `./src/routes/MainRoutes.tsx`**

{% hint style="warning" %}
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly. The file below
{% endhint %}
{% endtab %}

{% tab title="VITE (JS)" %}

## **file belowDisable Authentication Temporary**

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

1. Comment out the AuthGuard wrapper for the routes within the file below: `src/routes/MainRoutes.jsx`

{% code title="src/routes/MainRoutes.jsx" %}

```javascript
// import AuthGuard from 'utils/route-guard/AuthGuard';

...
...
const MainRoutes = {
    path: '/',
    element: (
        // <AuthGuard>
        <MainLayout />
        // </AuthGuard>
    ),
    ...
}
```

{% endcode %}

In the code snippet above, the `<AuthGuard>` a component is commented out, allowing the routes within the `MainLayout` component to be rendered without authentication protection. To enable the AuthGuard wrapper again, remove the comment markers (`//`) surrounding the `<AuthGuard>` component.

***

## Remove Authentication Permanent   &#x20;

If you want to permanently remove authentication from a system or application, here are the steps to follow:

1. **Remove below authentication keys below from `.env` file.**

{% code title=".env" %}

```javascript
...
...
## Firebase - Google Auth 
VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=

## AWS
VITE_APP_AWS_POOL_ID=
VITE_APP_AWS_APP_CLIENT_ID=

## Auth0
VITE_APP_AUTH0_CLIENT_ID=
VITE_APP_AUTH0_DOMAIN=
...
...
```

{% endcode %}

2. **Removed below list of files and directories.**

```javascript
..
├── src
│   ├── ui-component\cards               
│   │   ├── AuthFooter.tsx
│   ├── context
│   │   ├── Auth0Context.tsx
│   │   ├── AWSCognitoContext.tsx
│   │   ├── FirebaseContext.tsx
│   │   ├── JWTContext.tsx
│   ├── hooks
│   │   ├── useAuth.ts
│   ├── views
│   │   ├── pages
│   │   │   ├── authentication (remove directory with all sub files)
│   ├── routes
│   │   ├── LoginRoutes.tsx
│   │   ├── AuthenticationRoutes.tsx
│   ├── types
│   │    ├── auth.ts
│   ├── utils
│   │   ├── route-guard (remove directory with all sub files)
...
```

**Remove `LoginRoutes and AuthenticationRoutes`**- \
Open file `src/routes/index.jsx`, and remove `LoginRoutes`, `AuthenticationRoutes` import.

{% code title="src/routes/index.jsx" %}

```javascript
import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

// routes
import MainRoutes from './MainRoutes';
import SimpleRoutes from './SimpleRoutes';

// project imports
import Loadable from 'ui-component/Loadable';

const PagesLanding = Loadable(lazy(() => import('views/pages/landing')));

// ==============================|| ROUTING RENDER ||============================== //

const router = createBrowserRouter(
  [{ path: '/', element: <PagesLanding /> }, SimpleRoutes, MainRoutes],
  {
    basename: import.meta.env.VITE_APP_BASE_NAME
  }
);

export default router;
```

{% endcode %}

4. **, Remove or change `/login` routes.**&#x20;
   1. &#x20;**If you want to remove routes**, remove the router component `RouterLink` or `Link` with `to=''` props.
   2. **If you want to change url**, set the home page URL as, and`to={DASHBOARD_PATH}` import `DASHBOARD_PATH` from `config` file.
5. **Remove `useAuth` hook** - Remove the below imports from throughout the project and set static values for user profile props.

```javascript
import useAuth from 'hooks/useAuth';
```

6. **Remove Axios interceptors response from&#x20;*****the ./src/utils/axios.ts*****&#x20;file. So the final version should look like the below:**

{% code title="utils/axios.js" %}

```javascript
import axios from 'axios';

const axiosServices = axios.create({ baseURL: import.meta.env.VITE_APP_API_URL || 'http://localhost:3010/' });

export default axiosServices;

// ==============================|| AXIOS - FOR MOCK SERVICES ||============================== //

export const fetcher = async (args: string | [string, AxiosRequestConfig]) => {
    const [url, config] = Array.isArray(args) ? args : [args];

    const res = await axiosServices.get(url, { ...config });

    return res.data;
};
```

{% endcode %}

7. **Remove import of `JWTProvider` from ./src/App.jsx**
8. **Remove import and usage of `AuthGuard` from `./src/routes/MainRoutes.jsx`**

{% hint style="warning" %}
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly.
{% endhint %}
{% endtab %}

{% tab title="NEXT (TS)" %}

## **Disable Authentication Temporary**

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

1. Comment out the `AuthGuard` wrapper for the routes within the `DashboardLayout` element:

{% code title="src/app/(dashboard)/layout.tsx" %}

```typescript
// project imports
import DashboardLayout from 'layout/MainLayout';
// import AuthGuard from 'utils/route-guard/AuthGuard';

// ==============================|| DASHBOARD LAYOUT ||============================== //

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    //<AuthGuard>
      <DashboardLayout>{children}</DashboardLayout>
   // </AuthGuard>
  );
}
```

{% endcode %}

In the code snippet above, the `<AuthGuard>` a component is commented out, allowing the routes within the `MainLayout` component to be rendered without authentication protection. To enable the AuthGuard wrapper again, remove the comment markers (`//`) surrounding the `<AuthGuard>` component.

***

## Remove Authentication Permanent   &#x20;

If you want to permanently remove authentication from a system or application, here are the steps to follow:

1. **Remove below authentication keys below from `.env` file.**

{% code title=".env" %}

```typescript
...
...
## Firebase - Google Auth 
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=

## AWS
NEXT_PUBLIC_AWS_POOL_ID=
NEXT_PUBLIC_AWS_APP_CLIENT_ID=

## Auth0
NEXT_PUBLIC_AUTH0_CLIENT_ID=
NEXT_PUBLIC_AUTH0_DOMAIN=

## SupaBase
SUPABASE_URL=
SUPABASE_ANON_KEY=
...
...
```

{% endcode %}

2. **Removed below list of files and directories.**

```typescript
..
├── src
│   ├── app
│   │   ├── (minimal)
│   │   │   ├── (auth) (remove directory with all sub files)
│   │   │   ├── pages
│   │   │   │   ├── Login (remove directory with all sub files)
│   │   │   │   ├── Register (remove directory with all sub files)
│   │   │   │   ├── reset-password (remove a directory with all sub files)
│   │   │   │   ├── forgot-password (remove a directory with all sub files)
│   │   │   │   ├── code-verification (remove a directory with all sub files)
│   │   │   │   ├── check-mail (remove a directory with all sub files)
│   ├── context
│   │   ├── Auth0Context.tsx
│   │   ├── AWSCognitoContext.tsx
│   │   ├── FirebaseContext.tsx
│   │   ├── JWTContext.tsx
│   │   ├── SupabaseContext.tsx
│   ├── hooks
│   │   ├── useAuth.ts
│   ├── types
│   │   ├── auth.ts
│   ├── ui-components
│   │   ├── cards               
│   │   │   ├── AuthFooter.tsx
│   ├── utils
│   │   ├── route-guard (remove a directory with all sub files)
│   ├── views
│   │   ├── pages 
│   │   │   ├── authentication (remove directory with all sub files)
```

3. **Remove `useAuth` hook** - Remove the below imports from throughout the project and set static values for user profile props.

```typescript
import useAuth from 'hooks/useAuth';
```

4. **Remove import of `JWTProvider` from ./src/store/ProviderWrapper.tsx**
5. **Remove import and usage of `AuthGuard` from ./src/app/(dashboard)/layout.tsx**

{% hint style="warning" %}
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly.
{% endhint %}
{% endtab %}

{% tab title="NEXT (JS)" %}

## **Disable Authentication Temporary**

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

1. Comment out the `AuthGuard` wrapper for the routes within the `DashboardLayout` element:

{% code title="src/app/(dashboard)/layout.jsx" %}

```javascript
import PropTypes from 'prop-types';

// project imports
import DashboardLayout from 'layout/MainLayout';
// import AuthGuard from 'utils/route-guard/AuthGuard';

// ==============================|| DASHBOARD LAYOUT ||============================== //

export default function Layout({ children }) {
  return (
    //<AuthGuard>
      <DashboardLayout>{children}</DashboardLayout>
   // </AuthGuard>
  );
}

Layout.propTypes = { children: PropTypes.node };

```

{% endcode %}

In the code snippet above, the `<AuthGuard>` a component is commented out, allowing the routes within the `MainLayout` component to be rendered without authentication protection. To enable the AuthGuard wrapper again, remove the comment markers (`//`) surrounding the `<AuthGuard>` component.

***

## Remove Authentication Permanent   &#x20;

If you want to permanently remove authentication from a system or application, here are the steps to follow:

1. **Remove below authentication keys below from `.env` file.**

{% code title=".env" %}

```javascript
...
...
## Firebase - Google Auth 
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=

## AWS
NEXT_PUBLIC_AWS_POOL_ID=
NEXT_PUBLIC_AWS_APP_CLIENT_ID=

## Auth0
NEXT_PUBLIC_AUTH0_CLIENT_ID=
NEXT_PUBLIC_AUTH0_DOMAIN=

## SupaBase
SUPABASE_URL=
SUPABASE_ANON_KEY=
...
...
```

{% endcode %}

2. **Removed below list of files and directories.**

```javascript
..
├── src
│   ├── app
│   │   ├── (minimal)
│   │   │   ├── (auth) (remove directory with all sub files)
│   │   │   ├── pages
│   │   │   │   ├── Login (remove directory with all sub files)
│   │   │   │   ├── Register (remove directory with all sub files)
│   │   │   │   ├── reset-password (remove a directory with all sub files)
│   │   │   │   ├── forgot-password (remove a directory with all sub files)
│   │   │   │   ├── code-verification (remove a directory with all sub files)
│   │   │   │   ├── check-mail (remove a directory with all sub files)
│   ├── context
│   │   ├── Auth0Context.jsx
│   │   ├── AWSCognitoContext.jsx
│   │   ├── FirebaseContext.jsx
│   │   ├── JWTContext.jsx
│   │   ├── SupabaseContext.jsx
│   ├── hooks
│   │   ├── useAuth.js
│   ├── ui-components
│   │   ├── cards               
│   │   │   ├── AuthFooter.jsx
│   ├── utils
│   │   ├── route-guard (remove a directory with all sub files)
│   ├── views
│   │   ├── pages 
│   │   │   ├── authentication (remove directory with all sub files)
```

3. **Remove `useAuth` hook** - Remove the below imports from throughout the project and set static values for user profile props.

```typescript
import useAuth from 'hooks/useAuth';
```

4. **Remove import of `JWTProvider` from ./src/store/ProviderWrapper.tsx**
5. **Remove import and usage of `AuthGuard` from ./src/app/(dashboard)/layout.tsx**

{% hint style="warning" %}
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codedthemes.gitbook.io/berry/routing/skip-login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
