Skip to content

Commit 38294d4

Browse files
committed
Allow logging in with email
1 parent b177a86 commit 38294d4

5 files changed

Lines changed: 20 additions & 220 deletions

File tree

assets/js/csa.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var SITE = {
109109
$loginError.show();
110110
}
111111

112-
var client = new window.TmcClient();
112+
var client = new window.TmcClient("2d2084443754c26933fa53548177386c8210bff472e8bd157df84033f24cadd5", "34a49ed3d20b8a524889cc64a4668e9fced34ab41b7c74a11689a4602e906a12");
113113

114114
if(client.getUser()) {
115115
$loginTrigger.text('Log out ' + client.getUser().username);
@@ -148,16 +148,15 @@ var SITE = {
148148
} else {
149149
client.authenticate({ username: username, password: password })
150150
.then(function(response) {
151-
$loginTrigger.text('Log out ' + client.getUser().username);
151+
152+
153+
$loginTrigger.text('Log out');
152154
$loginModal.modal('hide');
153155

154156
SITE.initQuiznator();
155157
})
156158
.catch(function() {
157159
var error = 'Invalid username or password.';
158-
if (username.indexOf("@") != -1) {
159-
error = error + " Note that you're supposed to log in with your username and NOT with your email."
160-
}
161160
showError(error);
162161
});
163162
}

assets/js/tmc-client-js/dist/tmc-client.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/tmc-client-js/dist/tmc-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ctf/index.html

Lines changed: 0 additions & 205 deletions
This file was deleted.

introduction/index.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,26 +326,32 @@ <h2>Read and reflect</h2>
326326
<div class="modal-content">
327327
<div class="modal-header">
328328
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
329-
<h4 class="modal-title">Log into your TestMyCode account</h4>
329+
<h4 class="modal-title">Log in with your MOOC.fi account</h4>
330330
</div>
331331
<div class="modal-body">
332332
<div class="alert alert-info">
333-
Don't have a TestMyCode account? <a href="https://tmc.mooc.fi/user/new" target="_blank">Sign up</a>.
333+
Don't have a MOOC.fi account? <a href="https://tmc.mooc.fi/user/new" target="_blank">Sign up</a>.
334334
</div>
335335

336336
<div class="alert alert-danger" id="tmc-login-error" style="display: none">
337337
</div>
338338

339339
<div class="form-group">
340-
<label>Username</label>
341-
<input type="text" id="tmc-login-username" class="form-control" placeholder="Username"/>
340+
<label>Username or email</label>
341+
<input type="text" id="tmc-login-username" class="form-control" placeholder="Username or email"/>
342342
</div>
343343

344344
<div class="form-group">
345345
<label>Password</label>
346346
<input type="password" id="tmc-login-password" class="form-control" placeholder="Password"/>
347347
</div>
348+
349+
<div class="form-group">
350+
<a href="https://tmc.mooc.fi/password_reset_keys/new">I forgot my password</a>
351+
</div>
348352
</div>
353+
354+
349355
<div class="modal-footer">
350356
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
351357
<button type="button" class="btn btn-primary" id="tmc-login-submit">Log in</button>

0 commit comments

Comments
 (0)