mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-12 09:40:46 +08:00
feat(GRA-763): add success and error SSO HTML templates
This commit is contained in:
parent
4c0a846435
commit
7f8ad1523e
1 changed files with 101 additions and 53 deletions
|
|
@ -10,72 +10,120 @@ type ssoCallbackTemplateConfig struct {
|
||||||
var ssoCallbackTemplate = template.Must(
|
var ssoCallbackTemplate = template.Must(
|
||||||
template.New("ssocallback").Parse(`<!DOCTYPE html>
|
template.New("ssocallback").Parse(`<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
|
<title>Netmaker :: SSO Success</title>
|
||||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
|
||||||
<title>Netmaker</title>
|
|
||||||
</head>
|
|
||||||
<style>
|
<style>
|
||||||
.text-responsive {
|
html,
|
||||||
font-size: calc(100% + 1vw + 1vh);
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 3rem;
|
||||||
|
color: rgb(25, 135, 84);
|
||||||
|
font-size: xx-large;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<img
|
||||||
<div class="row justify-content-center mt-5 p-5 align-items-center text-center">
|
src="https://raw.githubusercontent.com/gravitl/netmaker-docs/master/images/netmaker-github/netmaker-teal.png"
|
||||||
<a href="https://netmaker.io">
|
alt="netmaker logo"
|
||||||
<img src="https://raw.githubusercontent.com/gravitl/netmaker/master/img/netmaker-teal.png" alt="Netmaker"
|
id="logo"
|
||||||
width="75%" height="25%" class="img-fluid">
|
>
|
||||||
</a>
|
<h3>Server SSO Success</h3>
|
||||||
</div>
|
<h4>User {{.User}} has been successfully {{.Verb}}.</h4>
|
||||||
<div class="row justify-content-center mt-5 p-3 text-center">
|
<p>You can close this window now</p>
|
||||||
<div class="col">
|
|
||||||
<h2 class="text-responsive">{{.User}} has been successfully {{.Verb}}</h2>
|
|
||||||
<br />
|
|
||||||
<h2 class="text-responsive">You may now close this window.</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>`),
|
</html>`),
|
||||||
)
|
)
|
||||||
|
|
||||||
var ssoErrCallbackTemplate = template.Must(
|
var ssoErrCallbackTemplate = template.Must(
|
||||||
template.New("ssocallback").Parse(`<!DOCTYPE html>
|
template.New("ssocallback").Parse(`<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
|
<title>Netmaker :: SSO Error</title>
|
||||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
|
||||||
<title>Netmaker</title>
|
|
||||||
</head>
|
|
||||||
<style>
|
<style>
|
||||||
.text-responsive {
|
html, body {
|
||||||
font-size: calc(100% + 1vw + 1vh);
|
margin: 0px;
|
||||||
color: red;
|
padding: 0px;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
#logo {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 3rem;
|
||||||
|
color:rgb(223, 71, 89);
|
||||||
|
font-size: xx-large;
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
margin-top: 0rem;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<img
|
||||||
<div class="row justify-content-center mt-5 p-5 align-items-center text-center">
|
src="https://raw.githubusercontent.com/gravitl/netmaker-docs/master/images/netmaker-github/netmaker-teal.png"
|
||||||
<a href="https://netmaker.io">
|
alt="netmaker logo"
|
||||||
<img src="https://raw.githubusercontent.com/gravitl/netmaker/master/img/netmaker-teal.png" alt="Netmaker"
|
id="logo"
|
||||||
width="75%" height="25%" class="img-fluid">
|
>
|
||||||
</a>
|
<h3>Server SSO Error</h3>
|
||||||
</div>
|
<h4>Error reason: {.Verb}</h4>
|
||||||
<div class="row justify-content-center mt-5 p-3 text-center">
|
<em>Your Netmaker server may not have SSO configured properly.</em>
|
||||||
<div class="col">
|
<em>
|
||||||
<h2 class="text-responsive">{{.User}} unable to join network: {{.Verb}}</h2>
|
Please visit the <a href="https://docs.netmaker.org/oauth.html" target="_blank" rel="noopener">docs</a> for more information.
|
||||||
<br />
|
</em>
|
||||||
<h2 class="text-responsive">If you feel this is a mistake, please contact your network administrator.</h2>
|
<p>
|
||||||
</div>
|
If you feel this is a mistake, please contact your network administrator.
|
||||||
</div>
|
</p>
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>`),
|
</html>`),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue