Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
35031bf8
Commit
35031bf8
authored
Jul 09, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error message on login error
parent
059f199d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
auth_controller.js
app/components/auth/auth_controller.js
+5
-1
auth_service.js
app/components/auth/auth_service.js
+1
-2
login.html
app/components/auth/login.html
+1
-0
interceptors.js
app/zetalib/interceptors.js
+3
-3
No files found.
app/components/auth/auth_controller.js
View file @
35031bf8
...
...
@@ -35,7 +35,11 @@ auth.controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, Gener
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
);
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
)
.
error
(
function
(
data
){
$scope
.
message
=
data
.
title
;
debugger
;
})
}
else
{
console
.
log
(
"not valid"
);
...
...
app/components/auth/auth_service.js
View file @
35031bf8
...
...
@@ -19,14 +19,13 @@ auth.factory('LoginService', function ($http, $rootScope, $location, $log, $cook
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
//$window.sessionStorage.token = data.token;
$rootScope
.
loggedInUser
=
true
;
$location
.
path
(
"/dashboard"
);
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
// Erase the token if the user fails to log in
//delete $window.sessionStorage.token;
// Handle login errors here
$scope
.
message
=
'Error: Invalid user or password'
;
return
data
;
});
//.then(function (res) {
// $log.info(res.data[0]);
...
...
app/components/auth/login.html
View file @
35031bf8
<div
ng-app=
"zaerp.auth"
>
<div
class=
"col-md-6"
>
<h1>
Ulakbüs Login Form
</h1>
<span
class=
"label label-warning"
>
{{message}}
</span>
<form
name=
"loginForm"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit(loginForm)"
></form>
</div>
</div>
\ No newline at end of file
app/zetalib/interceptors.js
View file @
35031bf8
...
...
@@ -27,9 +27,9 @@ app.config(['$httpProvider', function ($httpProvider) {
if
(
response
.
data
.
is_login
===
true
){
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
;
$location
.
replace
();
//
if($location.path()==="/login"){
//
$location.path("/dashboard");
//
}
if
(
$location
.
path
()
===
"/login"
){
$location
.
path
(
"/dashboard"
);
}
}
if
(
response
.
data
.
screen
)
{
$location
.
path
(
response
.
data
.
screen
);
...
...
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