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
894
Issues
894
List
Boards
Labels
Service Desk
Milestones
Merge Requests
50
Merge Requests
50
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
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
7a86f2e5
Commit
7a86f2e5
authored
1 hour ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Destroy session server-side
parent
2ee36af5
epic/minds-pro
1 merge request
!507
WIP: (feat): Minds Pro (development branch) - Release 3
Pipeline
#78981153
failed with stages
in 7 minutes and 8 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
26 deletions
+41
-26
logout.component.ts
src/app/modules/auth/logout.component.ts
+4
-15
footer.component.html
src/app/modules/pro/channel/footer/footer.component.html
+1
-1
footer.component.ts
src/app/modules/pro/channel/footer/footer.component.ts
+10
-10
auth.service.ts
src/app/services/auth.service.ts
+24
-0
providers.ts
src/app/services/providers.ts
+2
-0
No files found.
src/app/modules/auth/logout.component.ts
View file @
7a86f2e5
import
{
Component
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Client
}
from
'
../../services/api
'
;
import
{
Session
}
from
'
../../services/session
'
;
import
{
AuthService
}
from
'
../../services/auth.service
'
;
@
Component
({
template
:
``
})
export
class
LogoutComponent
{
constructor
(
public
client
:
Client
,
public
router
:
Router
,
public
route
:
ActivatedRoute
,
public
session
:
Session
,
public
auth
:
AuthService
,
)
{
this
.
route
.
url
.
subscribe
(
segments
=>
{
this
.
logout
(
segments
&&
segments
.
length
>
1
&&
segments
[
1
].
toString
()
===
'
all
'
);
this
.
logout
(
segments
&&
segments
.
length
>
1
&&
segments
[
1
].
toString
()
===
'
all
'
);
});
}
logout
(
closeAllSessions
:
boolean
=
false
)
{
let
url
:
string
=
'
api/v1/authenticate
'
;
if
(
closeAllSessions
)
url
+=
'
/all
'
;
this
.
client
.
delete
(
url
);
this
.
session
.
logout
();
this
.
auth
.
logout
(
closeAllSessions
);
this
.
router
.
navigate
([
'
/login
'
]);
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/footer/footer.component.html
View file @
7a86f2e5
...
...
@@ -17,7 +17,7 @@
[href]=
"link.href"
>
{{link.title}}
</a>
<ng-container
*ngIf=
"
session.getLoggedInUser()
"
>
<ng-container
*ngIf=
"
currentUser
"
>
<ng-container
*ngIf=
"isStandalone"
>
<a
class=
"m-pro--channel-footer--link"
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/footer/footer.component.ts
View file @
7a86f2e5
import
{
Component
}
from
'
@angular/core
'
;
import
{
ProChannelService
}
from
"
../channel.service
"
;
import
{
Session
}
from
'
../../../../services/session
'
;
import
{
AuthService
}
from
'
../../../../services/auth.service
'
;
export
interface
SocialProfileMeta
{
...
...
@@ -21,11 +22,10 @@ export interface SocialProfileMeta {
export
class
ProChannelFooterComponent
{
constructor
(
private
channelService
:
ProChannelService
,
protected
_session
:
Session
)
{
}
protected
channelService
:
ProChannelService
,
protected
session
:
Session
,
protected
auth
:
AuthService
,
)
{
}
private
socialProfileMeta
:
SocialProfileMeta
[]
=
[
{
...
...
@@ -260,7 +260,7 @@ export class ProChannelFooterComponent {
}
logout
()
{
this
.
_session
.
logout
();
this
.
auth
.
logout
();
}
private
getSocialProfileMeta
(
key
:
string
):
SocialProfileMeta
{
...
...
@@ -286,14 +286,14 @@ export class ProChannelFooterComponent {
return
this
.
channelService
.
currentChannel
;
}
get
session
()
{
return
this
.
_session
;
}
get
isOwner
()
{
return
this
.
session
.
getLoggedInUser
()
&&
this
.
session
.
getLoggedInUser
().
guid
==
this
.
user
.
guid
;
}
get
currentUser
()
{
return
this
.
session
.
getLoggedInUser
();
}
get
currentUsername
()
{
return
this
.
session
.
getLoggedInUser
().
username
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/services/auth.service.ts
0 → 100644
View file @
7a86f2e5
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Client
}
from
'
./api/client
'
;
import
{
Session
}
from
'
./session
'
;
@
Injectable
()
export
class
AuthService
{
constructor
(
protected
readonly
client
:
Client
,
protected
readonly
session
:
Session
,
)
{
}
logout
(
closeAll
:
boolean
=
false
):
boolean
{
let
endpoint
:
string
=
'
api/v1/authenticate
'
;
if
(
closeAll
)
{
endpoint
+=
'
/all
'
;
}
this
.
client
.
delete
(
endpoint
);
this
.
session
.
logout
();
return
true
;
}
}
This diff is collapsed.
Click to expand it.
src/app/services/providers.ts
View file @
7a86f2e5
...
...
@@ -42,6 +42,7 @@ import { InMemoryStorageService } from "./in-memory-storage.service";
import
{
FeedsService
}
from
"
../common/services/feeds.service
"
;
import
{
ThemeService
}
from
"
../common/services/theme.service
"
;
import
{
GlobalScrollService
}
from
"
./ux/global-scroll.service
"
;
import
{
AuthService
}
from
'
./auth.service
'
;
export
const
MINDS_PROVIDERS
:
any
[]
=
[
{
...
...
@@ -222,4 +223,5 @@ export const MINDS_PROVIDERS : any[] = [
useFactory
:
ThemeService
.
_
,
deps
:
[
RendererFactory2
,
Client
,
Session
,
Storage
],
},
AuthService
,
];
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