Skip to content

Commit 3185ea1

Browse files
committed
SDK-495: Replacing index template with new style for index and changing Application ID to Scenario ID
1 parent 8a426c9 commit 3185ea1

File tree

6 files changed

+79
-21
lines changed

6 files changed

+79
-21
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
YOTI_APPLICATION_ID=yourApplicationId
1+
YOTI_APPLICATION_ID=yourScenarioId
22
YOTI_CLIENT_SDK_ID=yourClientSdkId
33
YOTI_KEY_FILE_PATH=yourKeyFilePath

examples/yoti_example_flask/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM python:3.6.3
2-
ARG YOTI_APPLICATION_ID
2+
ARG YOTI_SCENARIO_ID
33
ARG YOTI_CLIENT_SDK_ID
44
ARG YOTI_KEY_FILE_PATH
5-
RUN if [ "$YOTI_APPLICATION_ID" = "yourApplicationId" ] ; then echo YOTI_APPLICATION_ID not set; exit 1; else echo YOTI_APPLICATION_ID is $YOTI_APPLICATION_ID ; fi
5+
RUN if [ "$YOTI_SCENARIO_ID" = "yourScenarioId" ] ; then echo YOTI_SCENARIO_ID not set; exit 1; else echo YOTI_SCENARIO_ID is $YOTI_SCENARIO_ID ; fi
66
RUN if [ "$YOTI_CLIENT_SDK_ID" = "yourClientSdkId" ] ; then echo YOTI_CLIENT_SDK_ID not set; exit 1; else echo YOTI_CLIENT_SDK_ID is $YOTI_CLIENT_SDK_ID ; fi
77
RUN if [ "$YOTI_KEY_FILE_PATH" = "yourKeyFilePath" ] ; then echo YOTI_KEY_FILE_PATH not set; exit 1; else echo YOTI_KEY_FILE_PATH is $YOTI_KEY_FILE_PATH ; fi
88
ADD . /code

examples/yoti_example_flask/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
load_dotenv(dotenv_path)
1212

1313
from settings import (
14-
YOTI_APPLICATION_ID,
14+
YOTI_SCENARIO_ID,
1515
YOTI_CLIENT_SDK_ID,
1616
YOTI_KEY_FILE_PATH,
1717
)
@@ -28,7 +28,7 @@ def save_image(selfie_data):
2828

2929
@app.route('/')
3030
def index():
31-
return render_template('index.html', app_id=YOTI_APPLICATION_ID)
31+
return render_template('index.html', scenario_id=YOTI_SCENARIO_ID)
3232

3333

3434
@app.route('/yoti/auth')

examples/yoti_example_flask/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
build:
55
context: ./
66
args:
7-
YOTI_APPLICATION_ID: "${YOTI_APPLICATION_ID}"
7+
YOTI_SCENARIO_ID: "${YOTI_SCENARIO_ID}"
88
YOTI_CLIENT_SDK_ID: "${YOTI_CLIENT_SDK_ID}"
99
YOTI_KEY_FILE_PATH: "${YOTI_KEY_FILE_PATH}"
1010
ports:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from os import environ
22

3-
YOTI_APPLICATION_ID = environ.get('YOTI_APPLICATION_ID')
3+
YOTI_SCENARIO_ID = environ.get('YOTI_SCENARIO_ID')
44
YOTI_CLIENT_SDK_ID = environ.get('YOTI_CLIENT_SDK_ID')
55
YOTI_KEY_FILE_PATH = environ.get('YOTI_KEY_FILE_PATH')
Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,83 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html class="yoti-html">
3+
34
<head>
4-
<!-- Your header content -->
5-
<script src="https://sdk.yoti.com/clients/browser.2.2.0.js"></script>
6-
<meta charset="UTF-8">
7-
<title>Index</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7+
<title>Yoti client example</title>
8+
<link rel="stylesheet" type="text/css" href="/static/index.css" />
9+
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" />
810
</head>
911

10-
<body>
11-
<!-- Your website content -->
12+
<body class="yoti-body">
13+
14+
<main>
15+
<section class="yoti-top-section">
16+
<div class="yoti-logo-section">
17+
<img
18+
class="yoti-logo-image"
19+
src="/static/assets/logo.png"
20+
srcset="/static/assets/[email protected] 2x"
21+
alt="Yoti"/>
22+
</div>
23+
24+
<h1 class="yoti-top-header">We now accept Yoti</h1>
25+
26+
<div class="yoti-sdk-integration-section">
27+
<div id="yoti-share-button"></div>
28+
</div>
29+
30+
<div class="yoti-login-or-separator">or</div>
31+
32+
<div class="yoti-login-dialog">
33+
<h2 class="yoti-login-dialog-header">Login with your email:</h2>
34+
35+
<input class="yoti-input" type="text" placeholder="Name"/>
1236

13-
<!-- This span will create the Yoti button -->
14-
<span data-yoti-application-id="{{app_id}}">
15-
Log in with Yoti
16-
</span>
37+
<input class="yoti-input" type="text" placeholder="Email address"/>
1738

18-
<!-- This script snippet will also be required in your HTML body -->
19-
<script>
20-
_ybg.init()
39+
<div class="yoti-login-actions">
40+
<span class="yoti-login-forgot-button">forgot password?</span>
2141

42+
<button class="yoti-login-button">login</button>
43+
</div>
44+
</div>
45+
</section>
2246

47+
<section class="yoti-sponsor-app-section">
48+
<h3 class="yoti-sponsor-app-header">The Yoti app is free to download and use:</h3>
49+
50+
<div class="yoti-store-buttons-section">
51+
<a href="https://itunes.apple.com/us/app/yoti/id983980808?ls=1&mt=8" class="yoti-app-button-link">
52+
<img
53+
src="/static/assets/app-store-badge.png"
54+
srcset="/static/assets/[email protected] 2x"
55+
alt="Download on the App Store"/>
56+
</a>
57+
58+
<a href="https://play.google.com/store/apps/details?id=com.yoti.mobile.android.live" class="yoti-app-button-link">
59+
<img
60+
src="/static/assets/google-play-badge.png"
61+
srcset="/static/assets/[email protected] 2x"
62+
alt="get it on Google Play"/>
63+
</a>
64+
</div>
65+
</section>
66+
</main>
67+
68+
<script src="https://www.yoti.com/share/client/"></script>
69+
<script>
70+
window.Yoti.Share.init({
71+
"elements": [{
72+
"domId": "yoti-share-button",
73+
"scenarioId": "{{scenario_id}}",
74+
"button": {
75+
"label": "Use Yoti"
76+
}
77+
}]
78+
});
2379
</script>
80+
2481
</body>
82+
2583
</html>

0 commit comments

Comments
 (0)