Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vue2/src/vue-oidc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export function createOidcAuth(
const auth = new Vue({
data() {
return {
mgr,
user: null as User | null,
myRouter: null as Router | null
}
Expand Down
3 changes: 1 addition & 2 deletions vue3/src/sample-app/main-async.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createApp } from 'vue'
import App from './App.vue'
import { configureRouter } from './router-async'
import router from './router'
import { configureOidc } from './idsrvAuth-async'

void (async function() {
const idsrvAuth = await configureOidc()
const router = await configureRouter()

idsrvAuth.startup().then(ok => {
if (ok) {
Expand Down
6 changes: 5 additions & 1 deletion vue3/src/vue-oidc-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from 'vue-router';
import { UserManagerSettings, Logger, User, Profile, UserManagerEvents } from 'oidc-client';
import { UserManagerSettings, Logger, User, UserManager, Profile, UserManagerEvents } from 'oidc-client';
/**
* Indicates the sign in behavior.
*/
Expand Down Expand Up @@ -71,6 +71,10 @@ export interface OidcAuth {
* Required call before all the properties are reliably initialized.
* Should be called and waited on before starting the root Vue instance.
*/
/**
* User manager from oidc-client-ts
*/
readonly mgr: UserManager;
startup(): Promise<boolean>;
/**
* Hookup this auth instance with a vue-router instance.
Expand Down
7 changes: 7 additions & 0 deletions vue3/src/vue-oidc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export interface OidcAuth {
* Required call before all the properties are reliably initialized.
* Should be called and waited on before starting the root Vue instance.
*/

/**
* User manager from oidc-client-ts
*/
readonly mgr: UserManager;

startup(): Promise<boolean>
/**
* Hookup this auth instance with a vue-router instance.
Expand Down Expand Up @@ -180,6 +186,7 @@ export function createOidcAuth(
const authObj = reactive({
appUrl,
authName,
mgr,
user,
isAuthenticated: computed(() => !!user.value && !user.value.expired),
accessToken: computed(() =>
Expand Down