Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Zwordi
funkwhale
Commits
80117212
Verified
Commit
80117212
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fixed #2: now redirect to previous page after login
parent
6274031f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+1
-0
1 addition, 0 deletions
CHANGELOG
front/src/components/auth/Login.vue
+4
-1
4 additions, 1 deletion
front/src/components/auth/Login.vue
front/src/main.js
+1
-1
1 addition, 1 deletion
front/src/main.js
front/src/router/index.js
+2
-1
2 additions, 1 deletion
front/src/router/index.js
with
8 additions
and
3 deletions
CHANGELOG
+
1
−
0
View file @
80117212
...
...
@@ -7,6 +7,7 @@ Changelog
- Import: can now specify search template when querying import sources (#45)
- Player: better handling of errors when fetching the audio file (#46)
- Login form: now redirect to previous page after login (#2)
0.2.4 (2017-12-14)
...
...
This diff is collapsed.
Click to expand it.
front/src/components/auth/Login.vue
+
4
−
1
View file @
80117212
...
...
@@ -43,6 +43,9 @@ import auth from '@/auth'
export
default
{
name
:
'
login
'
,
props
:
{
next
:
{
type
:
String
}
},
data
()
{
return
{
// We need to initialize the component with any
...
...
@@ -69,7 +72,7 @@ export default {
}
// We need to pass the component's this context
// to properly make use of http in the auth service
auth
.
login
(
this
,
credentials
,
{
path
:
'
/library
'
},
function
(
response
)
{
auth
.
login
(
this
,
credentials
,
{
path
:
this
.
next
},
function
(
response
)
{
// error callback
if
(
response
.
status
===
400
)
{
self
.
error
=
'
invalid_credentials
'
...
...
This diff is collapsed.
Click to expand it.
front/src/main.js
+
1
−
1
View file @
80117212
...
...
@@ -32,7 +32,7 @@ Vue.http.interceptors.push(function (request, next) {
// redirect to login form when we get unauthorized response from server
if
(
response
.
status
===
401
)
{
logger
.
default
.
warn
(
'
Received 401 response from API, redirecting to login form
'
)
router
.
push
({
name
:
'
login
'
})
router
.
push
({
name
:
'
login
'
,
query
:
{
next
:
router
.
currentRoute
.
fullPath
}
})
}
})
})
...
...
This diff is collapsed.
Click to expand it.
front/src/router/index.js
+
2
−
1
View file @
80117212
...
...
@@ -30,7 +30,8 @@ export default new Router({
{
path
:
'
/login
'
,
name
:
'
login
'
,
component
:
Login
component
:
Login
,
props
:
(
route
)
=>
({
next
:
route
.
query
.
next
||
'
/library
'
})
},
{
path
:
'
/logout
'
,
...
...
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