-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement role assignment on sso users and log IP for sso signins
- Loading branch information
Showing
5 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { boot } from "quasar/wrappers"; | ||
import { useAuthStore } from "@/stores/auth"; | ||
import { getSSOProviderToken } from "@/ee/sso/api/sso"; | ||
|
||
export default boot(({ router }) => { | ||
// add callback route to frontend | ||
router.addRoute({ | ||
path: "/account/provider/callback", | ||
name: "ProviderCallback", | ||
component: () => import("@/ee/sso/views/ProviderCallback.vue"), | ||
beforeEnter: async () => { | ||
const auth = useAuthStore(); | ||
|
||
if (auth.loggedIn) { | ||
return true; | ||
} | ||
|
||
try { | ||
const result = await getSSOProviderToken(); | ||
auth.token = result.token; | ||
auth.username = result.username; | ||
auth.ssoLoginProvider = result.provider; | ||
} catch {} | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters