# Callback URL loop after login (Boot, Vue, Okta)

**URL:** <https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216>\
**Category:** Questions\
**Created:** [May 4, 2020, 3:28am UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216 "2020-05-04T03:28:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://devforum.okta.com/u/Ross)\
**Post date:** [May 4, 2020, 3:28am UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/1 "2020-05-04T03:28:29Z")

</div>

After logging in to my SPA, the browser is caught in a loop calling the /implicit/callback URL.

- Vue is running locally on [http://localhost:8080](http://localhost:8080)
- My redirect URL is set to the same in both my Vue Auth config as well as on my SPA dashboard.
- In my Vue router config, I have the following:  
path: ‘/implicit/callback’,  
component: Auth.handleCallback()
- Here are my app settings  
Login redirect URIs: [http://localhost:8080/implicit/callback](http://localhost:8080/implicit/callback)  
Logout redirect URIs:  
Login initiated by: App Only  
Initiate login URI: [http://localhost:8080/login](http://localhost:8080/login)

Here is auth config in Vue:  
Vue.use(Auth, {  
issuer: ‘[https://dev-218542.okta.com/oauth2/default](https://dev-218542.okta.com/oauth2/default)’,  
clientId: ‘0oaaw0ym1gV6XGPLT4x6’,  
redirectUri: ‘[http://localhost:8080/implicit/callback](http://localhost:8080/implicit/callback)’,  
scopes: [‘openid’, ‘profile’, ‘email’],  
pkce: true  
})

I’ve followed the Okta Vue quickstart, along with the tutorial here: developer dot okta dot com/blog/2018/11/20/build-crud-spring-and-vue

Thanks!

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [May 4, 2020, 5:17am UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/2 "2020-05-04T05:17:08Z")

</div>

Can you please post all the code in your router file?

---

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://devforum.okta.com/u/Ross)\
**Post date:** [May 6, 2020, 4:45pm UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/3 "2020-05-06T16:45:53Z")

</div>

Sure. I have also reviewed your tutorial, but I’m not using TS here. Thanks!

```
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Auth from '@okta/okta-vue'

Vue.use(Auth, {
  issuer: 'https://dev- *******.okta.com/oauth2/default',
  clientId: ' *********',
  redirectUri: 'http://localhost:8080/implicit/callback',
  scopes: ['openid', 'profile', 'email'],
  pkce: true
})

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {  
      requiresAuth: true  
    }
  },
  {
    path: '/clients',
    name: 'Clients',
    component: () => import(/* webpackChunkName: "clients" */ '../views/Clients.vue'),
    meta: {  
      requiresAuth: true  
    }
  },
  {
    path: '/implicit/callback',
    component: Auth.handleCallback()
  }
]

const router = new VueRouter({
  routes
})

router.beforeEach(Vue.prototype.$auth.authRedirectGuard());

export default router
```

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [May 6, 2020, 8:30pm UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/4 "2020-05-06T20:30:30Z")

</div>

Which tutorial are you using? This one uses JavaScript, not TypeScript:

> **[Build a Simple CRUD App with Spring Boot and Vue.js](https://developer.okta.com/blog/2018/11/20/build-crud-spring-and-vue)**
>
> Create a CRUD (create, read, update, and delete) application using Spring Boot and Vue.js.

---

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://devforum.okta.com/u/Ross)\
**Post date:** [May 7, 2020, 1:12am UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/5 "2020-05-07T01:12:32Z")

</div>

Yes that is the one, was just saying a also consulted [https://developer.okta.com/blog/2018/12/03/bootiful-spring-boot-java-vue-typescript](https://developer.okta.com/blog/2018/12/03/bootiful-spring-boot-java-vue-typescript) which seems similar in terms of auth server config.

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [May 7, 2020, 4:15pm UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/6 "2020-05-07T16:15:16Z")

</div>

I believe this is because you have `requiresAuth: true` for your `/` route. I’d suggest looking at the [Vue SDK docs](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-vue#readme) to see how to redirect to another URL (`/` is the default). I haven’t done this personally. If you can’t figure it out, please enter an issue in the GitHub project.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 24, 2024, 7:15pm UTC](https://devforum.okta.com/t/callback-url-loop-after-login-boot-vue-okta/9216/7 "2024-01-24T19:15:27Z")

</div>

Closed on January 24, 2024, 7:15pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
