Skip to content

Commit

Permalink
Merge pull request #167 from datasci4health/development
Browse files Browse the repository at this point in the history
Development fix to login
  • Loading branch information
lealfp authored Aug 12, 2020
2 parents aad2046 + 9da331c commit a9484ac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/adonisjs/app/Controllers/Http/AuthController.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AuthController {
return response.redirect('back')
}

const endpoint_url = Env.get("HARENA_MANAGER_URL") + "/api/v2/auth/login"
const endpoint_url = Env.get("HARENA_MANAGER_URL") + "/api/v2/auth/login"

var config = {
method: 'post',
Expand All @@ -47,20 +47,20 @@ class AuthController {

await axios(config)
.then(async function (endpoint_response) {

let user = endpoint_response.data
console.log("-----------------------------------------------------------------------------------------------------------")
console.log(user.token)
//let token = await auth.generate(user)

//console.log(token.token)
//request.cookie("token", token.token)
console.log('login feito')
//const data = { user : 'hello world' }
response.cookie('token', user.token)
//yield response.sendView('index', data)
return view.render('index', { user: user.toJSON() })
// return response.redirect('/space')
//return view.render('index', { user: user.toJSON() })
return response.route('index')
})
.catch(function (error) {
console.log(error);
Expand Down
4 changes: 2 additions & 2 deletions src/adonisjs/app/Controllers/Http/CaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CaseController {
await axios(config)
.then(function (endpoint_response) {
// return response.redirect('/author/author.html')
return response.redirect('/author')
return response.redirect('/home')
})
.catch(function (error) {
console.log(error);
Expand All @@ -130,7 +130,7 @@ class CaseController {
catch (e) {
console.log(e)
}
return response.redirect('/author')
// return response.redirect('/author')
}


Expand Down
4 changes: 2 additions & 2 deletions src/adonisjs/resources/views/layout/partials/breadcrumbs.edge
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="container-fluid" >
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ breadHome }}">Home</a></li>
<li class="breadcrumb-item active" aria-current="{{ breadDrafts }}">Drafts</li>
<li class="breadcrumb-item"><a href="{{ route('index') }}">Home</a></li>
<li class="breadcrumb-item active" aria-current="{{ route('cases_drafts') }}">Drafts</li>
</ol>
</nav>
</div>
4 changes: 2 additions & 2 deletions src/adonisjs/resources/views/registration/template.edge
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<div class="h-100 w-100 registration-padding">
<div>
<p id="template-title"></p>
<!--<p id="template-title"></p> -->
</div>

<h1>{{ pageTitle }}</h1>
Expand All @@ -50,4 +50,4 @@
<!-- end of div /.container -->

</body>
</html>
</html>

0 comments on commit a9484ac

Please sign in to comment.