Skip to content

Commit

Permalink
login page added #44
Browse files Browse the repository at this point in the history
  • Loading branch information
RumiAust authored and raghunandanarava committed Jun 7, 2022
1 parent 27844a3 commit 35359dc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Body, Controller, Post } from '@nestjs/common';
import {Body, Controller, Get, Post, Render} from '@nestjs/common';
import { UserService } from './user.service';
import { LoginUserDto } from './Dto/LoginUser.dto';

Expand All @@ -10,4 +10,11 @@ export class UserController {
login(@Body() loginUserDto: LoginUserDto) {
return this.userService.login(loginUserDto);
}

@Get('login')
@Render('login')
root() {
return;
}

}
7 changes: 6 additions & 1 deletion views/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
</table>
</form><br>
<button id="btn_enableAll" class="button enableButton">Enable All</button>
<button id="btn_disableAll" class="button disableButton">Disable All</button><br><br>
<button id="btn_disableAll" class="button disableButton">Disable All</button>
<button id="btn_login" class="button loginButton">Login</button><br><br>

<script>
function setAll(b) {
Expand All @@ -157,6 +158,10 @@
btn_enable.onclick = enableAll;
const btn_disable = document.querySelector('#btn_disableAll');
btn_disable.onclick = disableAll;
document.querySelector('#btn_login').onclick = function () {
location.href = 'http://localhost:8081/api/user/login';
};
</script>
{{#if result.success}}
{{#if first_query }}
Expand Down
13 changes: 13 additions & 0 deletions views/login.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<meta charset="utf-8" />
<title>App</title>
</head>
<body>
<div class="center">
<h3>Hello Login Page</h3>

<button id="btn_back" onclick="location.href = 'http://localhost:8081/api/discovery/issuer';" class="button backButton">Back</button><br><br>
</div>
</body>
</html>

0 comments on commit 35359dc

Please sign in to comment.