In this guide, We will check some authentication questions.
在本指南中,我们将检查一些身份验证问题。

How to remove Authentication from app completely. 如何从应用程序中完全删除身份验证。

Login 登录
First of all copy UI of one of our authentication method from three provided auth - LoginFirebase.vue, LoginAuth0.vue or LoginJWT.vue. Copy UI code of selected auth method and replace vs-tabs component from Login.vue file with copied code.
首先,从提供的三种身份验证-LoginFirebase.vue,LoginAuth0.vue或LoginJWT.vue中复制一种身份验证方法的UI。 复制所选身份验证方法的UI代码,并使用复制的代码替换Login.vue文件中的vs-tabs组件。

Next step is to add your auth methods and other stuff.
下一步是添加您的身份验证方法和其他内容。

Registration 注册
Also perform same for registration.
同登录

NavBar
Open /src/layouts/components/TheNavbar.vue and remove firebase import
打开/src/layouts/components/TheNavbar.vue并删除firebase导入
认证 - 图1

Update logout method as below:
更新注销登录方法如下:

  1. logout() {
  2. // So, you can still visit login page
  3. this.$router.push('/pages/login').catch(() => {})
  4. },

Store
Let’s go over store and do some cleanup. Open /src/store/auth/moduleAuthActions.js file and remove all content. Do same for moduleAuthState.js and moduleAuthMutations.js
让我们对store做一些清理。 打开/src/store/auth/moduleAuthActions.js文件并删除所有内容。 对moduleAuthState.js和moduleAuthMutations.js执行相同的操作

TIP If you don’t want auth at later remove > /src/store/auth folder and also remove module registration of auth module from > /src/store/store.js 如果您不想进行身份验证,请删除/src/store/auth文件夹,并从/src/store/store.js中删除auth模块的模块注册。
Router**
Let’s head over to /src/router.js file. Remove firebase and auth0 import from top of this file.
让我们转到/src/router.js文件。 从此文件的顶部删除firebase和auth0导入。
认证 - 图2

Finally at the bottom of this file remove router.beforeEach. From now on authRequired meta property is useless for any route.
最后,在此文件的底部删除router.beforeEach。 从现在开始,authRequired元属性对任何路由都无效。
认证 - 图3
Remove auth0 callback component from route.
从路由中删除auth0回调组件。
认证 - 图4

Files
Next step, Remove callback component from your admin. Go to /src/views/ and remove Callback.vue file.
下一步,从管理员中删除回调组件。 转到/src/views/并删除Callback.vue文件。
认证 - 图5

Now update /src/App.vue file as below.
现在,如下所示更新/src/App.vue文件。

  1. async created() {
  2. window.addEventListener('resize', this.handleWindowResize)
  3. window.addEventListener('scroll', this.handleScroll)
  4. }

Remove firebase and auth0 import from src/main.js file
从src / main.js文件中删除firebase和auth0导入
认证 - 图6
Remove auth, firebase folders and plugins/auth.js from project.
从项目中删除auth,firebase文件夹和plugins / auth.js。
认证 - 图7

Remove auth0 config file auth_config.json from root of your project.
从项目的根目录中删除auth0配置文件auth_config.json。

At last remove auth0 and firebase from package.json file.
最后,从package.json文件中删除auth0和firebase。
认证 - 图8

Let’s remove some jwt code. remove /src/fake-db/data/users folder.
让我们删除一些jwt代码。 删除/ src / fake-db / data / users文件夹。

Congrats! You have successfully removed authentication from template. Now, you can integrate you own authentication system as you like. All the best.
恭喜! 您已成功从模板删除身份验证。 现在,您可以根据需要集成自己的身份验证系统。 祝一切顺利。