Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
838
Issues
838
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
574e8ad7
Commit
574e8ad7
authored
1 hour ago
by
Emiliano Balbuena
Committed by
Mark Harding
1 hour ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Redirect to /login and back if not logged in during upgrade
parent
178c8c16
epic/pro-affiliate-launch
1 merge request
!590
WIP: Epic/pro affiliate launch
Pipeline
#89261962
running with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
8 deletions
+49
-8
src/app/modules/auth/login.component.ts
src/app/modules/auth/login.component.ts
+18
-2
src/app/modules/plus/subscription/subscription.component.ts
src/app/modules/plus/subscription/subscription.component.ts
+16
-3
src/app/modules/pro/subscription/subscription.component.ts
src/app/modules/pro/subscription/subscription.component.ts
+15
-3
No files found.
src/app/modules/auth/login.component.ts
View file @
574e8ad7
...
...
@@ -66,12 +66,12 @@ export class LoginComponent {
loggedin
()
{
if
(
this
.
referrer
)
this
.
router
.
navigateByUrl
(
this
.
referrer
);
else
if
(
this
.
redirectTo
)
this
.
router
.
navigate
([
this
.
redirectTo
]
);
else
if
(
this
.
redirectTo
)
this
.
navigateToRedirection
(
);
else
this
.
loginReferrer
.
navigate
();
}
registered
()
{
if
(
this
.
redirectTo
)
this
.
router
.
navigate
([
this
.
redirectTo
]
);
if
(
this
.
redirectTo
)
this
.
navigateToRedirection
(
);
else
{
this
.
modal
.
setDisplay
(
'
categories
'
).
open
();
this
.
loginReferrer
.
navigate
({
...
...
@@ -79,4 +79,20 @@ export class LoginComponent {
});
}
}
navigateToRedirection
()
{
const
uri
=
this
.
redirectTo
.
split
(
'
?
'
,
2
);
const
extras
=
{};
if
(
uri
[
1
])
{
extras
[
'
queryParams
'
]
=
{};
for
(
const
queryParamString
of
uri
[
1
].
split
(
'
&
'
))
{
const
queryParam
=
queryParamString
.
split
(
'
=
'
);
extras
[
'
queryParams
'
][
queryParam
[
0
]]
=
queryParam
[
1
];
}
}
this
.
router
.
navigate
([
uri
[
0
]],
extras
);
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/plus/subscription/subscription.component.ts
View file @
574e8ad7
...
...
@@ -6,7 +6,7 @@ import {
OnInit
,
Output
,
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Params
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'
@angular/router
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
Session
}
from
'
../../../services/session
'
;
...
...
@@ -19,6 +19,7 @@ import {
UpgradeOptionInterval
,
}
from
'
../../upgrades/upgrade-options.component
'
;
import
currency
from
'
../../../helpers/currency
'
;
import
{
Location
}
from
'
@angular/common
'
;
@
Component
({
selector
:
'
m-plus--subscription
'
,
...
...
@@ -54,7 +55,8 @@ export class PlusSubscriptionComponent implements OnInit {
protected
overlayModal
:
OverlayModalService
,
protected
wirePaymentHandlers
:
WirePaymentHandlersService
,
protected
cd
:
ChangeDetectorRef
,
protected
route
:
ActivatedRoute
protected
route
:
ActivatedRoute
,
protected
router
:
Router
)
{}
ngOnInit
()
{
...
...
@@ -69,7 +71,9 @@ export class PlusSubscriptionComponent implements OnInit {
this
.
currency
=
params
.
c
||
'
usd
'
;
this
.
interval
=
params
.
i
||
'
yearly
'
;
if
(
params
.
c
||
params
.
i
)
this
.
enable
();
if
(
params
.
c
||
params
.
i
)
{
this
.
enable
();
}
}
);
}
...
...
@@ -91,6 +95,15 @@ export class PlusSubscriptionComponent implements OnInit {
}
async
enable
()
{
if
(
!
this
.
session
.
isLoggedIn
())
{
localStorage
.
setItem
(
'
redirect
'
,
`/plus?c=
${
this
.
currency
}
&i=
${
this
.
interval
}
`
);
this
.
router
.
navigate
([
'
/login
'
]);
return
;
}
this
.
inProgress
=
true
;
this
.
error
=
''
;
this
.
detectChanges
();
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/subscription/subscription.component.ts
View file @
574e8ad7
...
...
@@ -6,7 +6,7 @@ import {
OnInit
,
Output
,
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Params
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'
@angular/router
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
Session
}
from
'
../../../services/session
'
;
...
...
@@ -54,7 +54,8 @@ export class ProSubscriptionComponent implements OnInit {
protected
overlayModal
:
OverlayModalService
,
protected
wirePaymentHandlers
:
WirePaymentHandlersService
,
protected
cd
:
ChangeDetectorRef
,
protected
route
:
ActivatedRoute
protected
route
:
ActivatedRoute
,
protected
router
:
Router
)
{}
ngOnInit
()
{
...
...
@@ -69,7 +70,9 @@ export class ProSubscriptionComponent implements OnInit {
this
.
currency
=
params
.
c
||
'
usd
'
;
this
.
interval
=
params
.
i
||
'
yearly
'
;
if
(
params
.
c
||
params
.
i
)
this
.
enable
();
if
(
params
.
c
||
params
.
i
)
{
this
.
enable
();
}
}
);
}
...
...
@@ -91,6 +94,15 @@ export class ProSubscriptionComponent implements OnInit {
}
async
enable
()
{
if
(
!
this
.
session
.
isLoggedIn
())
{
localStorage
.
setItem
(
'
redirect
'
,
`/pro?c=
${
this
.
currency
}
&i=
${
this
.
interval
}
`
);
this
.
router
.
navigate
([
'
/login
'
]);
return
;
}
this
.
inProgress
=
true
;
this
.
error
=
''
;
this
.
detectChanges
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment