Skip to content
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

Added a page for bookmark. #1881

Merged
merged 2 commits into from
Jan 19, 2022
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions auth-web/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ router.beforeEach((to, from, next) => {
})
}
return next({
path: '/unauthorized',
query: { redirect: to.fullPath }
path: '/bookmark',
query: { bookmarkPath: to.fullPath }
})
}
if (to.matched.some(record => record.meta.isPremiumOnly)) {
Expand Down
8 changes: 8 additions & 0 deletions auth-web/src/routes/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import AccountSetupView from '@/views/auth/create-account/AccountSetupView.vue'
import AccountUnlockSuccessView from '@/views/auth/account-freeze/AccountUnlockSuccessView.vue'
import AffidavitDownload from '@/components/auth/create-account/non-bcsc/AffidavitDownload.vue'
import AuthenticationOptionsView from '@/views/auth/AuthenticationOptionsView.vue'
import BookmarkLoginView from '@/views/auth/BookmarkLoginView.vue'
import BusinessProfileView from '@/views/auth/BusinessProfileView.vue'
import CcPaymentReturnView from '@/views/pay/CcPaymentReturnView.vue'
import CcPaymentView from '@/views/pay/CcPaymentView.vue'
Expand Down Expand Up @@ -628,6 +629,13 @@ export function getRoutes (): RouteConfig[] {
props: true,
meta: { requiresAuth: false }
},
{
path: '/bookmark',
name: 'bookmark',
component: BookmarkLoginView,
props: true,
meta: { requiresAuth: false }
},
{
path: '/account/:orgId/restricted-product/:productName?',
name: 'RestrictedProduct',
Expand Down
63 changes: 63 additions & 0 deletions auth-web/src/views/auth/BookmarkLoginView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<v-container class="view-container">
<v-row justify="center">
<v-col class="text-center">
<div class="mt-5 mb-10 font-weight-bold">
<h1>BC Registries Account Login</h1>
</div>
<v-card
class="mx-auto"
max-width="460"
>
<v-card-title>
<v-img
max-height="260"
src="@/assets/img/BCReg_Generic_Login_image.jpg"
alt="Generic Login Image">
</v-img>
</v-card-title>
<v-card-text >
<v-menu>
<template v-slot:activator="{ on }">
<v-btn
large
color="bcgovblue"
class="white--text font-weight-bold"
aria-label="log in"
id="loginBtn"
v-on="on">
<span>Log in to my BC Registries Account</span>
<v-icon class="mr-n1 ml-2">mdi-menu-down</v-icon>
</v-btn>
</template>
<sbc-auth-menu :redirect-on-login-success="bookmarkPath" />
</v-menu>
<div class="mb-12"></div>
</v-card-text>
</v-card>
</v-col>
</v-row>
</v-container>
</template>

<script lang="ts">
import { Component } from 'vue-property-decorator'
import SbcAuthMenu from 'sbc-common-components/src/components/SbcAuthMenu.vue'
import Vue from 'vue'

@Component({
components: {
SbcAuthMenu
}
})
export default class BookmarkLoginView extends Vue {
/** The route bookmarkPath. */
get bookmarkPath (): string {
return this.$route.query?.bookmarkPath as string
}
}
</script>

<style lang="scss" scoped>
@import "$assets/scss/theme.scss";
</style>
6 changes: 5 additions & 1 deletion auth-web/src/views/auth/SigninView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export default class Signin extends Mixins(NextPageMixin) {
if (this.$store.getters['auth/isAuthenticated']) {
this.$root.$emit('signin-complete', () => {
if (this.redirectUrl) {
this.redirectTo(decodeURIComponent(CommonUtils.isUrl(this.redirectUrl) ? this.redirectUrl : `/${this.redirectUrl}`))
if (this.redirectUrl.startsWith('/')) {
this.redirectTo(this.redirectUrl)
} else {
this.redirectTo(decodeURIComponent(CommonUtils.isUrl(this.redirectUrl) ? this.redirectUrl : `/${this.redirectUrl}`))
}
} else {
this.redirectTo(this.getNextPageUrl())
}
Expand Down