-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context route auth redirect #6314
Conversation
@@ -4,3 +4,9 @@ | |||
<p v-translate class="oc-invisible">Loading app</p> | |||
</div> | |||
</template> | |||
|
|||
<script> | |||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added the script part to give the component a name and let my IDE give the imports pretty colors. Meaning: not really related to the changes in this PR, semantically.
@@ -1,6 +1,7 @@ | |||
import get from 'lodash-es/get.js' | |||
import Vue from 'vue' | |||
import Router from 'vue-router' | |||
// eslint-disable-next-line no-unused-vars | |||
import Router, { Route } from 'vue-router' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Route
is not used in code but in a docblock. Apparently eslint doesn't consider docblocks.
@@ -15,13 +15,13 @@ const appInfo = { | |||
const routes = [ | |||
{ | |||
name: 'apps', | |||
path: '/:file_id/:app?', | |||
path: '/:contextRouteName/:file_id/:app?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the contextRouteName so that we can check the auth requirements of the context route (and redirect to IDP login page if coming from a private context).
135c6c0
to
a52a2c2
Compare
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -241,6 +241,7 @@ export default { | |||
const routeData = this.$router.resolve({ | |||
name: 'external-apps', | |||
params: { | |||
contextRouteName: this.$route.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I'm late but this would have been a chance to introduce a common helper for params to external and the other apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to do that in a separate PR? 😇 and/or create an issue? 😊
Description
This PR includes the contextRoute of the next route when checking if authentication is required.
In the (hopefully very near) future this can be expanded to public links with password protection. But for now this simple PR solves the case of bookmarks to editors having a file open from a private context.
Related Issue
How Has This Been Tested?
Types of changes
Checklist: