Browse Source

feat: guard with handmade

ryanemax 1 ngày trước cách đây
mục cha
commit
a45d060385
2 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 1 1
      src/app/app.routes.ts
  2. 6 0
      src/app/wxwork-auth-guard.ts

+ 1 - 1
src/app/app.routes.ts

@@ -1,5 +1,5 @@
 import { Routes } from '@angular/router';
-import { WxworkAuthGuard } from 'fmode-ng/social'; 
+import { WxworkAuthGuard } from './wxwork-auth-guard'; 
 
 export const routes: Routes = [
   // 客服路由

+ 6 - 0
src/app/wxwork-auth-guard.ts

@@ -0,0 +1,6 @@
+import { CanActivateFn } from '@angular/router';
+import { checkWeworkLogin } from 'fmode-ng/core';
+
+export const WxworkAuthGuard: CanActivateFn = async (route, state) => {
+  return checkWeworkLogin(route);
+};