Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Commits
60977e94
Commit
60977e94
authored
5 years ago
by
Dominik Seeger
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Tutor assignments not freed when logging out"
parent
74228073
No related branches found
No related tags found
1 merge request
!233
Resolve "Tutor assignments not freed when logging out"
Pipeline
#128234
passed
5 years ago
Stage: build
Stage: test
Stage: pages
Stage: staging
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/store/actions.ts
+4
-3
4 additions, 3 deletions
frontend/src/store/actions.ts
frontend/src/store/modules/authentication.ts
+9
-0
9 additions, 0 deletions
frontend/src/store/modules/authentication.ts
with
13 additions
and
3 deletions
frontend/src/store/actions.ts
+
4
−
3
View file @
60977e94
...
...
@@ -80,9 +80,10 @@ function logout (
message
=
''
)
{
if
(
Authentication
.
isStudent
&&
!
ConfigModule
.
state
.
config
.
exerciseMode
)
{
// change active to false when user logs out
// TODO this should belong in auth module
api
.
changeActiveForUser
(
Authentication
.
state
.
user
.
pk
,
false
)
Authentication
.
deactivateUserAccount
()
}
if
(
Authentication
.
isTutorOrReviewer
)
{
Assignments
.
cleanAssignments
()
}
router
.
push
({
name
:
'
login
'
},
()
=>
{
resetState
({
message
})
...
...
This diff is collapsed.
Click to expand it.
frontend/src/store/modules/authentication.ts
+
9
−
0
View file @
60977e94
...
...
@@ -112,6 +112,14 @@ async function getUser () {
}
}
/**
* Deactivates the current user's account.
* They will not be able to login again until activated again.
*/
async
function
deactivateUserAccount
({
state
}:
BareActionContext
<
AuthState
,
RootState
>
)
{
api
.
changeActiveForUser
(
state
.
user
.
pk
,
false
)
}
export
const
Authentication
=
{
get
state
()
{
return
stateGetter
()
},
get
gradySpeak
()
{
return
gradySpeakGetter
()
},
...
...
@@ -131,4 +139,5 @@ export const Authentication = {
getJWT
:
mb
.
dispatch
(
getJWT
),
refreshJWT
:
mb
.
dispatch
(
refreshJWT
),
getUser
:
mb
.
dispatch
(
getUser
),
deactivateUserAccount
:
mb
.
dispatch
(
deactivateUserAccount
),
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment