Skip to content

Commit

Permalink
Bcsc login fix (#875)
Browse files Browse the repository at this point in the history
* BCSC - Frozen on one screen#4300

* handling route from common components

* redirection only for non sbc-auth routes

* removing unwanted check

* cc version to 2.2.3
  • Loading branch information
nitheesh-aot authored Jul 14, 2020
1 parent 2137445 commit 2da0f19
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"moment": "^2.24.0",
"regenerator-runtime": "^0.13.3",
"register-service-worker": "^1.6.2",
"sbc-common-components": "^2.2.2",
"sbc-common-components": "^2.2.3",
"vue": "^2.6.11",
"vue-i18n": "^8.0.0",
"vue-property-decorator": "^8.3.0",
Expand Down
4 changes: 1 addition & 3 deletions auth-web/src/components/auth/mixins/NextPageMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ export default class NextPageMixin extends Vue {
// Redirect to dashboard otherwise
if (!this.userProfile?.userTerms?.isTermsOfUseAccepted) {
bceidNextStep = Pages.USER_PROFILE_TERMS
} else if (!this.currentUser?.roles?.includes(Role.AccountHolder)) {
bceidNextStep = Pages.CHOOSE_AUTH_METHOD
} else if (!this.currentOrganization && !this.currentMembership) {
bceidNextStep = Pages.CREATE_NON_BCSC_ACCOUNT
bceidNextStep = Pages.CHOOSE_AUTH_METHOD
} else if (this.currentOrganization && this.currentOrganization.statusCode === OrgStatus.PendingAffidavitReview) {
bceidNextStep = `${Pages.PENDING_APPROVAL}/${this.currentAccountSettings?.label}`
} else if (this.currentOrganization && this.currentMembership.membershipStatus === MembershipStatus.Active) {
Expand Down
13 changes: 5 additions & 8 deletions auth-web/src/views/auth/SigninView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,16 @@ export default class Signin extends Mixins(NextPageMixin) {
@Prop({ default: '' }) redirectUrl: string
@Prop({ default: '' }) redirectUrlLoginFail: string
private async authenticationComplete (isRedirectToCreateAccount = false) {
private async authenticationComplete () {
await this.loadUserInfo()
// Check if user is authenticated, and redirect according to specified redirect
// or fallback to default route for their login source
if (this.$store.getters['auth/isAuthenticated']) {
this.$root.$emit('signin-complete', () => {
// isRedirectToCreateAccount: if true, redirection already happend from sbc-common-components
if (!isRedirectToCreateAccount) {
if (this.redirectUrl) {
this.redirectTo(decodeURIComponent(CommonUtils.isUrl(this.redirectUrl) ? this.redirectUrl : `/${this.redirectUrl}`))
} else {
this.redirectTo(this.getNextPageUrl())
}
if (this.redirectUrl) {
this.redirectTo(decodeURIComponent(CommonUtils.isUrl(this.redirectUrl) ? this.redirectUrl : `/${this.redirectUrl}`))
} else {
this.redirectTo(this.getNextPageUrl())
}
})
}
Expand Down

0 comments on commit 2da0f19

Please sign in to comment.