diff --git a/sso/auth.php b/sso/auth.php index cf929a9..b26610b 100644 --- a/sso/auth.php +++ b/sso/auth.php @@ -1,15 +1,15 @@ login($username, $email); - $forum->redirectToForum(); -} elseif (!empty($username) || !empty($password)) { - echo 'Login failed'; -} \ No newline at end of file +$forum = new Forum(); +$forum->login($username, $email, $avatarUrl); +$forum->redirectToForum(); diff --git a/sso/index.php b/sso/index.php index e9e61a5..5284427 100644 --- a/sso/index.php +++ b/sso/index.php @@ -16,6 +16,112 @@ + + @@ -27,8 +133,47 @@

A user is logged into members area. Let's demonstrate SSO with Flarum.

- Visit Forum -
href="/auth.php?auth_token=test"
+
+
+

Fake data generated using faker.js

+ +
+
+
+ +
+ +
+ +
+
+
Developer
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ +
+
+
+
+
@@ -50,8 +195,19 @@ name: randomName }; var encoded = window.btoa(JSON.stringify(fake)); + console.log(fake); console.log(encoded); + + var authRedirect = "/auth.php?auth_token=" + encoded; + $('.visit-link').attr("href", authRedirect); + + $('.profile-userpic .img-responsive').attr("src", randomAvatar); + $('.profile-usertitle-name').html(randomName); + $('.container pre').html(authRedirect); + $('.username').html(randomUsername); + $('.email').html(randomEmail); +