Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
funkwhale
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
167
Issues
167
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
funkwhale
funkwhale
Commits
80117212
Verified
Commit
80117212
authored
Dec 15, 2017
by
Agate
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #2: now redirect to previous page after login
parent
6274031f
Pipeline
#283
passed with stage
in 41 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
CHANGELOG
CHANGELOG
+1
-0
front/src/components/auth/Login.vue
front/src/components/auth/Login.vue
+4
-1
front/src/main.js
front/src/main.js
+1
-1
front/src/router/index.js
front/src/router/index.js
+2
-1
No files found.
CHANGELOG
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)
...
...
front/src/components/auth/Login.vue
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
'
...
...
front/src/main.js
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
}
})
}
})
})
...
...
front/src/router/index.js
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
'
,
...
...
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